Sha256: bfd5c7fb2cbfa1562a23d2add293b75540d3235c3d4199853db7070c1197d915

Contents?: true

Size: 822 Bytes

Versions: 6

Compression:

Stored size: 822 Bytes

Contents

require 'spec_helper'
def generate_unique_email
  @@email_count ||= 0
  @@email_count += 1
  "test#{@@email_count}@example.com"
end

def valid_attributes(attributes={})
  { :email => generate_unique_email,
    :password => '12345678',
    :password_confirmation => '12345678' }.update(attributes)
end

def new_user(attributes={})
  User.new(valid_attributes(attributes))
end

def create_user(attributes={})
  User.create!(valid_attributes(attributes))
end

def fill_sign_in_form(email, password)
  visit new_user_session_path
  within("#new_user") do
    fill_in 'Email', :with => email
    fill_in 'Password', :with => password
  end
  click_on 'Sign in'
end

def sign_cookie(name, val)
  verifier = ActiveSupport::MessageVerifier.new(SafeguardDeviseTestApp::Application.config.secret_token)
  verifier.generate(val)
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
safeguard-devise-0.0.7 spec/tests_helper/helpers.rb
safeguard-devise-0.0.6 spec/tests_helper/helpers.rb
safeguard-devise-0.0.5 spec/tests_helper/helpers.rb
safeguard-devise-0.0.4 spec/tests_helper/helpers.rb
safeguard-devise-0.0.3 spec/tests_helper/helpers.rb
safeguard-devise-0.0.2 spec/tests_helper/helpers.rb