Created
February 27, 2012 20:55
-
-
Save koriroys/1926968 to your computer and use it in GitHub Desktop.
This file contains 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
def login_user(email = 'kori', password = 'kori') | |
user = User.create!(:email => email, :password => password) | |
post session_path(:email => user.email, :password => user.password) | |
response.should redirect_to(root_path) | |
end | |
def make_valid_post | |
post posts_path(:title => "whee", :site_link => "whee") | |
end |
This file contains 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
describe "a user voting on a thing" do | |
it "is not allowed unless user is logged in" do | |
post posts_path(:title => "whee", :site_link => "whee") | |
response.should redirect_to(login_path) | |
end | |
pending "is allowed if logged in user has not voted on that thing" do | |
login_user | |
make_valid_post | |
# vote_on post <--- STUCK HERE | |
end | |
pending "is not allowed if logged in user has voted on that that thing" do | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment