Created
April 6, 2012 11:56
-
-
Save dipesh-p/2319172 to your computer and use it in GitHub Desktop.
food_categories_spec.rb
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
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