Skip to content

Instantly share code, notes, and snippets.

@dbernar1
Created November 7, 2011 03:45
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 dbernar1/1344135 to your computer and use it in GitHub Desktop.
Save dbernar1/1344135 to your computer and use it in GitHub Desktop.
specs for testing content of the account menu on a website
it "displays create account and sign in links, and doesn't display sing out link to non-logged in users" do
render
rendered.should have_selector( '.sign-in' ) do |account_menu|
account_menu.should contain 'Create Account'
account_menu.should contain 'Sign In'
account_menu.should_not contain 'Sign Out'
end
end
it "displays sign out link, and doesn't display create account and sign in links to logged in users" do
render
rendered.should have_selector( '.sign-in' ) do |account_menu|
account_menu.should_not contain 'Create Account'
account_menu.should_not contain 'Sign In'
account_menu.should contain 'Sign Out'
end
end
@dbernar1
Copy link
Author

dbernar1 commented Nov 7, 2011

Both tests pass, which is kinda not awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment