Sha256: 6c193ffec0ee6d49fa5d7a54e2dd8503538d2d1c9b233954194929ff28170ba7

Contents?: true

Size: 1.3 KB

Versions: 21

Compression:

Stored size: 1.3 KB

Contents

require 'rspec-steps'


RSpec.shared_steps "expand the menu" do
  collapsed_menu_sizes=[ :mobile, :small ]

  it "clicks on the menu (if needed)" do |example|
    if collapsed_menu_sizes.include?(Waterpig::BrowserSize.current_size(example))
      click_on('Menu')
    end
  end
end

RSpec.shared_steps "visit login" do
  it "visits root" do
    begin
      visit '/'
    rescue Object => ex
      p ex
      raise
    end
  end

  perform_steps "expand the menu"

  it "clicks on Sign In" do
    within ".session-links" do
      click_link "Sign In"
    end
  end
end

RSpec.shared_steps "sign up with" do
  it "visits root" do
    visit '/'
  end

  perform_steps "expand the menu"

  it "clicks Sign Up" do
    click_on "Sign Up"
  end

  it "fills in email and pasword" do
    fill_in "Email",           :with => @user.email
    fill_in "Email Confirmation", :with => @user.email
    fill_in "Password",        :with => @user.password
    fill_in "Password Confirmation", :with => @user.password
  end

  it "clicks Sign Up" do
    click_button "Sign Up"
  end
end

RSpec.shared_steps "sign in with" do
  perform_steps "visit login"

  it "fills in email and password" do
    fill_in "Email", :with => @user.email
    fill_in "Password", :with => @user.password
  end

  it "clicks Sign In" do
    click_button "Sign In"
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
xing-framework-1.0.0.pre.beta.1 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-1.0.0.pre.beta default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-1.0.0.pre.alpha default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.3.2 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.3.1 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.3.0 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.9 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.9.beta1 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.8 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.8.beta1 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.7 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.7.pre.beta1 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.6 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.5 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.4 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.3 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.2 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.1 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.2.0 default_configuration/base_app/backend/spec/support/session_helpers.rb
xing-framework-0.0.3 default_configuration/base_app/backend/spec/support/session_helpers.rb