diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-01-05 13:00:39 -0800 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-01-05 13:00:39 -0800 |
commit | 346d9c6bde5ae0a0c918b4e0b25d79aa2760234a (patch) | |
tree | e0c78ee00bdcdd308dd88fc339c96095001ff1d4 /spec/relations | |
parent | 4366f8658e75ead57070427c09b0c57abe683df9 (diff) | |
download | rails-346d9c6bde5ae0a0c918b4e0b25d79aa2760234a.tar.gz rails-346d9c6bde5ae0a0c918b4e0b25d79aa2760234a.tar.bz2 rails-346d9c6bde5ae0a0c918b4e0b25d79aa2760234a.zip |
basic rename functionality
Diffstat (limited to 'spec/relations')
-rw-r--r-- | spec/relations/attribute_spec.rb | 6 | ||||
-rw-r--r-- | spec/relations/relation_spec.rb | 6 | ||||
-rw-r--r-- | spec/relations/table_relation_spec.rb | 24 |
3 files changed, 28 insertions, 8 deletions
diff --git a/spec/relations/attribute_spec.rb b/spec/relations/attribute_spec.rb index d8a007f918..7015fd2542 100644 --- a/spec/relations/attribute_spec.rb +++ b/spec/relations/attribute_spec.rb @@ -6,6 +6,12 @@ describe Attribute do @relation2 = TableRelation.new(:bar) end + describe 'aliaz' do + it "manufactures an aliased attributed" do + pending + end + end + describe '#eql?' do it "obtains if the relation and attribute name are identical" do Attribute.new(@relation1, :attribute_name).should be_eql(Attribute.new(@relation1, :attribute_name)) diff --git a/spec/relations/relation_spec.rb b/spec/relations/relation_spec.rb index db4b6b8775..5cef7d7b3d 100644 --- a/spec/relations/relation_spec.rb +++ b/spec/relations/relation_spec.rb @@ -48,6 +48,12 @@ describe Relation do end end + describe Relation, '#rename' do + it "manufactures a rename relation" do + @relation1.rename(@attribute1, :foo).should == RenameRelation.new(@relation1, @attribute1, :foo) + end + end + describe Relation, '#select' do before do @predicate = EqualityPredicate.new(@attribute1, @attribute2) diff --git a/spec/relations/table_relation_spec.rb b/spec/relations/table_relation_spec.rb index 8cd31a9ac8..dec8bba6b1 100644 --- a/spec/relations/table_relation_spec.rb +++ b/spec/relations/table_relation_spec.rb @@ -1,13 +1,21 @@ require File.join(File.dirname(__FILE__), '..', 'spec_helper') -describe TableRelation, '#to_sql' do - it "returns a simple SELECT query" do - TableRelation.new(:users).to_sql.should == SelectBuilder.new do |s| - select do - column :users, :name - column :users, :id +describe TableRelation do + describe '#to_sql' do + it "returns a simple SELECT query" do + TableRelation.new(:users).to_sql.should == SelectBuilder.new do |s| + select do + column :users, :name + column :users, :id + end + from :users end - from :users end end -end + + describe '#attributes' do + it 'manufactures attributes corresponding to columns in the table' do + pending + end + end +end
\ No newline at end of file |