Sha256: 2029c89f661b5f968df32e14e3476182c7ea401d57a432b43982938f0b2884f6
Contents?: true
Size: 1.78 KB
Versions: 26
Compression:
Stored size: 1.78 KB
Contents
******************************************************************************* Next: 1. To run the generated tests, you'll need shoulda, factory_girl, webrat, and fakeweb. Update your config/environments/test.rb: config.gem "shoulda" config.gem "factory_girl" config.gem "webrat" config.gem "fakeweb" Unless they are already included. 2. Update your test_helper.rb with: FakeWeb.allow_net_connect = false Webrat.configure do |config| config.mode = :rails config.open_error_files = false end class ActionController::IntegrationTest include Webrat::Matchers def sign_in_as(email, password, url_to_visit = sign_in_url) visit url_to_visit fill_in "Email", :with => email fill_in "Password", :with => password click_button "sign in" end def reset_session request.reset_session controller.instance_variable_set(:@_current_user, nil) end def sign_up(options = {}) visit new_user_url fill_in "email", :with => options[:email] || 'bob@bob.bob' fill_in "first name", :with => options[:first_name] || 'Bob' fill_in "last name", :with => options[:last_name] || 'Bob' fill_in "password", :with => options[:password] || 'password' fill_in "confirm password", :with => options[:password_confirmation] || options[:password] || 'password' click_button 'sign up' end def sign_out visit session_url, :delete end end 3. Be sure to define a root_url in routes.rb. *******************************************************************************
Version data entries
26 entries across 26 versions & 4 rubygems