Sha256: 3d762fe299724cc3fcb247f59005ddf0f084c72c505c2d8b318c61e94723810b

Contents?: true

Size: 1.78 KB

Versions: 11

Compression:

Stored size: 1.78 KB

Contents

module Refinery
  module Testing
    module RequestMacros
      module Authentication
        def login_refinery_user
          before do
            password = '123456'
            refinery_user = FactoryGirl.create(:refinery_user, {
              :username => "refinerycms",
              :password => password,
              :password_confirmation => password,
              :email => "refinerycms@refinerycms.com"
            })

            visit refinery.new_refinery_user_session_path

            fill_in "Login", :with => refinery_user.username
            fill_in "Password", :with => password

            click_button "Sign in"
          end
        end

        def login_refinery_superuser
          before(:each) do
            password = '123456'
            refinery_superuser = FactoryGirl.create(:refinery_superuser, {
              :username => "refinerycms",
              :password => password,
              :password_confirmation => password,
              :email => "refinerycms@refinerycms.com"
            })

            visit refinery.new_refinery_user_session_path

            fill_in "Login", :with => refinery_superuser.username
            fill_in "Password", :with => password

            click_button "Sign in"
          end
        end

        def login_refinery_translator
          before do
            password = '123456'
            FactoryGirl.create(:refinery_user)
            user = FactoryGirl.create(:refinery_translator, {
              :password => password,
              :password_confirmation => password
            })

            visit refinery.new_refinery_user_session_path

            fill_in "Login", :with => user.username
            fill_in "Password", :with => password

            click_button "Sign in"
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
refinerycms-testing-2.0.10 lib/refinery/testing/request_macros/authentication.rb
refinerycms-testing-2.0.9 lib/refinery/testing/request_macros/authentication.rb
refinerycms-testing-2.0.8 lib/refinery/testing/request_macros/authentication.rb
refinerycms-testing-2.0.7 lib/refinery/testing/request_macros/authentication.rb
refinerycms-testing-2.0.6 lib/refinery/testing/request_macros/authentication.rb
refinerycms-testing-2.0.5 lib/refinery/testing/request_macros/authentication.rb
refinerycms-testing-2.0.4 lib/refinery/testing/request_macros/authentication.rb
refinerycms-testing-2.0.3 lib/refinery/testing/request_macros/authentication.rb
refinerycms-testing-2.0.2 lib/refinery/testing/request_macros/authentication.rb
refinerycms-testing-2.0.1 lib/refinery/testing/request_macros/authentication.rb
refinerycms-testing-2.0.0 lib/refinery/testing/request_macros/authentication.rb