Sha256: ac2fadb05a7b026eeff25bcc0117ad0d2fe0333a891f3b2ee964f4a438e80bbb

Contents?: true

Size: 848 Bytes

Versions: 8

Compression:

Stored size: 848 Bytes

Contents

module Alchemy
	module Specs
		# Helpers for integration specs
		# This file is auto included in rspec integration/request tests.
		module Helpers

			# Capybara actions to login into Alchemy Backend
			# 
			# === IMPORTANT NOTE:
			# 
			# Because of a very strange bug in capybara, or rspec, or what ever, you **MUST** create the user inside a +before(:all)+ block inside your integrations specs.
			# 
			# === Example:
			# 
			#   before(:all) do
			#     Factory.build(:admin_user).save_without_session_maintenance
			#   end
			# 
			def login_into_alchemy
				visit '/alchemy/admin/login'
				fill_in('alchemy_user_session_login', :with => 'jdoe')
				fill_in('alchemy_user_session_password', :with => 's3cr3t')
				click_on('Login')
			end

		end
	end
end

RSpec.configure do |c|
	c.include Alchemy::Specs::Helpers, :type => :request
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
alchemy_cms-2.1.12 spec/support/alchemy/specs_helpers.rb
alchemy_cms-2.1.11 spec/support/alchemy/specs_helpers.rb
alchemy_cms-2.1.9.1 spec/support/alchemy/specs_helpers.rb
alchemy_cms-2.1.9 spec/support/alchemy/specs_helpers.rb
alchemy_cms-2.1.8.1 spec/support/alchemy/specs_helpers.rb
alchemy_cms-2.1.8 spec/support/alchemy/specs_helpers.rb
alchemy_cms-2.1.7 spec/support/alchemy/specs_helpers.rb
alchemy_cms-2.1.6 spec/support/alchemy/specs_helpers.rb