Fix failing specs due to addition of another enterprise

This commit is contained in:
Rohan Mitchell
2015-01-14 14:42:31 +11:00
parent 642de2f65f
commit f0bd9c1065

View File

@@ -326,11 +326,12 @@ feature %q{
let(:distributor2) { create(:distributor_enterprise, name: 'Another Distributor') }
let(:distributor3) { create(:distributor_enterprise, name: 'Yet Another Distributor') }
let(:enterprise_user) { create_enterprise_user }
let!(:er) { create(:enterprise_relationship, parent: distributor3, child: distributor1, permissions_list: [:edit_profile]) }
let(:er) { create(:enterprise_relationship, parent: distributor3, child: distributor1, permissions_list: [:edit_profile]) }
before(:each) do
enterprise_user.enterprise_roles.build(enterprise: supplier1).save
enterprise_user.enterprise_roles.build(enterprise: distributor1).save
er
login_to_admin_as enterprise_user
end
@@ -348,10 +349,16 @@ feature %q{
expect(page).to_not have_select "enterprise_set_collection_attributes_0_sells"
end
within("tr.enterprise-#{distributor3.id}") do
expect(page).to have_content distributor3.name
expect(page).to have_unchecked_field "enterprise_set_collection_attributes_1_is_primary_producer"
expect(page).to_not have_select "enterprise_set_collection_attributes_1_sells"
end
within("tr.enterprise-#{supplier1.id}") do
expect(page).to have_content supplier1.name
expect(page).to have_checked_field "enterprise_set_collection_attributes_1_is_primary_producer"
expect(page).to_not have_select "enterprise_set_collection_attributes_1_sells"
expect(page).to have_checked_field "enterprise_set_collection_attributes_2_is_primary_producer"
expect(page).to_not have_select "enterprise_set_collection_attributes_2_sells"
end
expect(page).to_not have_content "supplier2.name"