Module: Refinery::Testing::RequestMacros::Authentication

Defined in:
lib/refinery/testing/request_macros/authentication.rb

Instance Method Summary collapse

Instance Method Details

#login_refinery_superuserObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/refinery/testing/request_macros/authentication.rb', line 24

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

    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

#login_refinery_translatorObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/refinery/testing/request_macros/authentication.rb', line 43

def 
  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

#login_refinery_userObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/refinery/testing/request_macros/authentication.rb', line 5

def 
  before do
    password = '123456'
    refinery_user = FactoryGirl.create(:refinery_user, {
      :username => "refinerycms",
      :password => password,
      :password_confirmation => password,
      :email => "[email protected]"
    })

    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