Sha256: ebfbf07aedf237af8c0c2d67ba6c9d3db1ad5f1a96b226882edd48a75f7918a7

Contents?: true

Size: 912 Bytes

Versions: 4

Compression:

Stored size: 912 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

4 entries across 4 versions & 1 rubygems

Version Path
alchemy_cms-2.2.rc6 spec/support/alchemy/specs_helpers.rb
alchemy_cms-2.2.rc3 spec/support/alchemy/specs_helpers.rb
alchemy_cms-2.2.rc2 spec/support/alchemy/specs_helpers.rb
alchemy_cms-2.2.rc1 spec/support/alchemy/specs_helpers.rb