modify enterprise eror name message #620

This commit is contained in:
Rory Trunkhill
2018-05-17 18:10:35 +00:00
parent e356d712c4
commit 5706cecf26
2 changed files with 5 additions and 7 deletions

View File

@@ -2208,7 +2208,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
content_configuration_pricing_table: "(TODO: Pricing table)"
content_configuration_case_studies: "(TODO: Case studies)"
content_configuration_detail: "(TODO: Detail)"
enterprise_name_error: "has already been taken. If this is your enterprise and you would like to claim ownership, please contact the current manager of this profile at %{email}."
enterprise_name_error: "has already been taken. If this is your enterprise and you would like to claim ownership, or if you would like to trade with this enterprise please contact the current manager of this profile at %{email}."
enterprise_owner_error: "^%{email} is not permitted to own any more enterprises (limit is %{enterprise_limit})."
enterprise_role_uniqueness_error: "^That role is already present."
inventory_item_visibility_error: must be true or false

View File

@@ -129,17 +129,15 @@ describe Enterprise do
it "prevents duplicate names for new records" do
e = Enterprise.new name: enterprise.name
e.should_not be_valid
e.errors[:name].first.should ==
"has already been taken. If this is your enterprise and you would like to claim ownership, please contact the current manager of this profile at owner@example.com."
expect(e).to_not be_valid
expect(e.errors[:name].first).to include I18n.t('enterprise_name_error', email: owner.email)
end
it "prevents duplicate names for existing records" do
e = create(:enterprise, name: 'foo')
e.name = enterprise.name
e.should_not be_valid
e.errors[:name].first.should ==
"has already been taken. If this is your enterprise and you would like to claim ownership, please contact the current manager of this profile at owner@example.com."
expect(e).to_not be_valid
expect(e.errors[:name].first).to include I18n.t('enterprise_name_error', email: owner.email)
end
it "does not prohibit the saving of an enterprise with no name clash" do