diff options
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/public_body_category_link_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/public_body_heading_spec.rb | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/spec/models/public_body_category_link_spec.rb b/spec/models/public_body_category_link_spec.rb index 7108f124b..5964a164e 100644 --- a/spec/models/public_body_category_link_spec.rb +++ b/spec/models/public_body_category_link_spec.rb @@ -17,7 +17,7 @@ describe PublicBodyHeading, 'when validating' do category_link = PublicBodyCategoryLink.new(:public_body_heading => heading, :public_body_category => category) category_link.valid? - category_link.category_display_order.should == PublicBodyCategoryLink.next_display_order(heading_with_no_categories) + category_link.category_display_order.should == PublicBodyCategoryLink.next_display_order(heading) end end @@ -25,8 +25,8 @@ end describe PublicBodyCategoryLink, 'when setting a category display order' do it 'should return 0 if there are no public body headings' do - heading_with_no_categories = FactoryGirl.create(:heading_with_no_categories) - PublicBodyCategoryLink.next_display_order(heading_with_no_categories).should == 0 + heading = FactoryGirl.create(:public_body_heading) + PublicBodyCategoryLink.next_display_order(heading).should == 0 end it 'should return one more than the highest display order if there are public body headings' do diff --git a/spec/models/public_body_heading_spec.rb b/spec/models/public_body_heading_spec.rb index 5e581e713..dd0517072 100644 --- a/spec/models/public_body_heading_spec.rb +++ b/spec/models/public_body_heading_spec.rb @@ -37,7 +37,7 @@ describe PublicBodyHeading do end it 'should require a unique name' do - heading = FactoryGirl.create(:silly_heading) + heading = FactoryGirl.create(:public_body_heading) new_heading = PublicBodyHeading.new(:name => heading.name) new_heading.should_not be_valid new_heading.errors[:name].should == ["Name is already taken"] @@ -57,8 +57,8 @@ describe PublicBodyHeading do end it 'should return one more than the highest display order if there are public body headings' do - heading = FactoryGirl.create(:popular_heading) - PublicBodyHeading.next_display_order.should == 2 + heading = FactoryGirl.create(:public_body_heading) + PublicBodyHeading.next_display_order.should == 1 end end end |