-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Fix authentification helper methods inclusion on tests
- Loading branch information
1 parent
8dfed31
commit 545ecd6
Showing
6 changed files
with
33 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
src/api/spec/support/controllers/controllers_authentification.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module ControllersAuthentification | ||
def login(user) | ||
request.session[:login] = user.login | ||
end | ||
|
||
def logout | ||
request.session[:login] = nil | ||
end | ||
end | ||
|
||
RSpec.configure do |c| | ||
c.include ControllersAuthentification, type: :controller | ||
end |
16 changes: 16 additions & 0 deletions
16
src/api/spec/support/features/features_authentification.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module FeaturesAuthentification | ||
def login(user, password = 'buildservice') | ||
visit user_login_path | ||
fill_in 'Username', with: user.login | ||
fill_in 'Password', with: password | ||
click_button 'Log In' | ||
end | ||
|
||
def logout | ||
visit user_logout_path | ||
end | ||
end | ||
|
||
RSpec.configure do |c| | ||
c.include FeaturesAuthentification, type: :feature | ||
end |
This file was deleted.
Oops, something went wrong.