Skip to content

Instantly share code, notes, and snippets.

@dipesh-p
Created April 6, 2012 11:56
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 dipesh-p/2319172 to your computer and use it in GitHub Desktop.
Save dipesh-p/2319172 to your computer and use it in GitHub Desktop.
food_categories_spec.rb
require 'spec_helper'
describe "FoodCategories" do
before :each do
establishment = Establishment.create(:name => 'Havmor')
@user = User.create(:email => 'user@example.com', :password => 'password', :establishment_id => establishment.id, :is_establishment_admin => true)
end
before do
visit '/users/sign_in'
fill_in 'Email', :with => 'user@example.com'
fill_in 'Password', :with => 'password'
click_button 'Sign in'
#@request.env["devise.mapping"] = Devise.mappings[:user]
end
it "displays the user's username after successful login" do
page.should have_content("Signed in successfully.")
end
it "works! (now write some real specs)" do
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
get food_categories_path
response.status.should be(200)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment