spec/support/feature_macros.rb in storytime-0.0.1 vs spec/support/feature_macros.rb in storytime-0.0.2

- old
+ new

@@ -1,15 +1,15 @@ module FeatureMacros def login(user = nil, skip_site = false) setup_site unless skip_site - user ||= FactoryGirl.create(:user) - visit new_user_session_path + user ||= FactoryGirl.create(:writer) + visit main_app.new_user_session_path fill_in "user_email", :with => user.email fill_in "user_password", :with => user.password - click_on "Log In" + click_on "Sign in" page.should have_content("Signed in successfully.") @current_user = user end def login_admin(admin = nil) @@ -32,7 +32,11 @@ @current_site end def setup_site @current_site = FactoryGirl.create(:site) + end + + def base_url + "http://#{Capybara.current_session.server.host}:#{Capybara.current_session.server.port}" end end