spec/organizations_spec.rb in zendesk2-0.0.18 vs spec/organizations_spec.rb in zendesk2-0.0.19
- old
+ new
@@ -18,10 +18,12 @@
user = client.users.create(email: "#{Zendesk2.uuid}@example.org", name: Zendesk2.uuid, organization: organization)
ticket = client.tickets.create(subject: "#{Zendesk2.uuid}@example.org", description: Zendesk2.uuid, requester: user)
organization.tickets.should include ticket
end
- it "should raise on name conflict" do
- lambda { client.organizations.create(name: organization.name) }.should raise_exception(Zendesk2::Error)
+ it "should hate non-unique names" do
+ lambda { client.organizations.create!(name: organization.name) }.should raise_exception(Zendesk2::Error)
+ model = client.organizations.create(name: organization.name)
+ model.errors.should == {"name" => ["Name: has already been taken"]}
end
end
end