Skip to content

Instantly share code, notes, and snippets.

@senny
Last active January 2, 2016 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save senny/8282638 to your computer and use it in GitHub Desktop.
Save senny/8282638 to your computer and use it in GitHub Desktop.
test "Can't register with a username that has been taken" do
create(:user, username: "already-taken")
assert_raises(ActiveRecord::RecordNotSaved) do
post "/register", username: "already-taken"
end
end
test "can access dotted-resources with dashes" do
create(:resource, path: "one.two")
get "/resources/one-two"
# raised an ActiveRecord::RecordNotFound
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment