mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 10:49:39 +02:00
Add session helper for feature specs
This commit is contained in:
parent
5c04681fc0
commit
9c8eba9ea9
2 changed files with 14 additions and 0 deletions
|
@ -5,6 +5,7 @@ require 'rspec/rails'
|
|||
require 'capybara/poltergeist'
|
||||
require 'paper_trail/frameworks/rspec'
|
||||
require 'money-rails/test_helpers'
|
||||
require 'support/features/session_helpers'
|
||||
|
||||
if ENV['ROBOT']
|
||||
require 'simplecov'
|
||||
|
@ -23,6 +24,7 @@ ActiveRecord::Migration.maintain_test_schema!
|
|||
RSpec.configure do |config|
|
||||
config.include ActionView::TestCase::Behavior, type: :presenter
|
||||
config.include ActiveSupport::Testing::TimeHelpers
|
||||
config.include Features::SessionHelpers, type: :feature
|
||||
|
||||
config.define_derived_metadata(file_path: %r{/spec/presenters/}) do |metadata|
|
||||
metadata[:type] = :presenter
|
||||
|
|
12
spec/support/features/session_helpers.rb
Normal file
12
spec/support/features/session_helpers.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
module Features
|
||||
module SessionHelpers
|
||||
def sign_in_to_registrar_area(user: FactoryGirl.create(:api_user))
|
||||
visit registrar_login_path
|
||||
|
||||
fill_in 'depp_user_tag', with: user.username
|
||||
fill_in 'depp_user_password', with: user.password
|
||||
|
||||
click_button 'Login'
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue