Last active
January 2, 2016 09:19
-
-
Save senny/8282638 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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