Sha256: 0bed3c9d1b61c885667cde31cdcf0587b27dff657e92a128869d034772a05626

Contents?: true

Size: 916 Bytes

Versions: 2

Compression:

Stored size: 916 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
      #     FactoryGirl.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

2 entries across 2 versions & 1 rubygems

Version Path
alchemy_cms-2.2.rc8 spec/support/alchemy/specs_helpers.rb
alchemy_cms-2.2.rc7 spec/support/alchemy/specs_helpers.rb