Switch to correct grammatical ordering of child/parent enterprise on enterprise relationships page

This commit is contained in:
Rohan Mitchell
2014-08-26 15:42:35 +10:00
parent a5debc19dc
commit 1871d42e68
5 changed files with 10 additions and 10 deletions

View File

@@ -119,6 +119,6 @@ feature %q{
def have_relationship(parent, child, perms=[])
perms = perms.join(' ') || 'permits'
have_table_row [parent.name, perms, child.name, '']
have_table_row [child.name, perms, parent.name, '']
end
end

View File

@@ -6,10 +6,10 @@ describe EnterpriseRelationship do
let(:e2) { create(:enterprise, name: 'B') }
let(:e3) { create(:enterprise, name: 'C') }
it "sorts by parent, child enterprise name" do
er1 = create(:enterprise_relationship, parent: e1, child: e3)
er2 = create(:enterprise_relationship, parent: e2, child: e1)
er3 = create(:enterprise_relationship, parent: e1, child: e2)
it "sorts by child, parent enterprise name" do
er1 = create(:enterprise_relationship, parent: e3, child: e1)
er2 = create(:enterprise_relationship, parent: e1, child: e2)
er3 = create(:enterprise_relationship, parent: e2, child: e1)
EnterpriseRelationship.by_name.should == [er3, er1, er2]
end