Sha256: 6772bbbb504f3b32f6c7f7d3a8dd6c500e97e333c414ecba1129bcc611f3a6fb

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

require 'spec_helper'
require 'support/features/feature_helpers'

feature 'visitor signs up' do
  scenario 'navigates to sign up page' do
    visit sign_in_path
    click_link 'Sign Up'
    expect_sign_up_page
  end

  scenario 'signs up with valid email and password' do
    sign_up_with 'valid@example.com', 'password'
    expect_user_to_be_signed_in
  end

  scenario 'signs up with invalid email' do
    sign_up_with 'bad_email', 'password'
    expect_user_to_be_signed_out
  end

  scenario 'signs up with invalid short password' do
    sign_up_with 'bad_email', '111'
    expect_user_to_be_signed_out
  end

  scenario 'signs up with blank password' do
    sign_up_with 'bad_email', ''
    expect_user_to_be_signed_out
  end
end


def expect_sign_up_page
  expect(current_path).to eq sign_up_path
end

def sign_up_with(email, password)
  visit sign_up_path
  fill_in 'user_email', with: email
  fill_in 'user_password', with: password
  click_button 'Sign up'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
authenticate-0.3.1 spec/features/sign_up_spec.rb
authenticate-0.3.0 spec/features/sign_up_spec.rb