-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajouter des liens, sur la fiche d'un utilisateur, pour que les admins…
… puissent retirer les rôles d'un utilisateur
- Loading branch information
Showing
10 changed files
with
93 additions
and
32 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 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 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 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 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,15 @@ | ||
require "spec_helper" | ||
|
||
def log_user(login, password) | ||
visit '/my/page' | ||
expect(current_path).to eq '/login' | ||
|
||
click_on("ou s'authentifier par login / mot de passe") | ||
|
||
within('#login-form form') do | ||
fill_in 'username', with: login | ||
fill_in 'password', with: password | ||
find('input[name=login]').click | ||
end | ||
expect(current_path).to eq '/my/page' | ||
end |
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,36 @@ | ||
require "spec_helper" | ||
require "active_support/testing/assertions" | ||
require_relative "../support/login_user_spec_helpers" | ||
|
||
RSpec.describe "/issue/id/edit", type: :system do | ||
include ActiveSupport::Testing::Assertions | ||
|
||
include ApplicationHelper | ||
include OrganizationsHelper | ||
include ActionView::Helpers::UrlHelper | ||
|
||
fixtures :organizations, :users, :roles, :projects, :members, :member_roles, | ||
:organization_managers, :organization_team_leaders | ||
before do | ||
log_user('admin', 'admin') | ||
end | ||
|
||
it "Should display delete links for member and team leader in profile page" do | ||
user = User.find(2) | ||
user.organization = Organization.find(2) | ||
user.save | ||
|
||
visit "/users/#{user.id}" | ||
|
||
organization_manager = user.organization_managers.map(&:organization).compact | ||
team_leader_organizations = user.organization_team_leaders.map(&:organization).compact | ||
|
||
organization_manager.each do |organization| | ||
expect(page).to have_link(nil, href: organizations_manager_path(id: organization.id, manager_id: user.id, page: "user")) | ||
end | ||
|
||
team_leader_organizations.each do |organization| | ||
expect(page).to have_link(nil, href: organizations_team_leader_path(id: organization.id, team_leader_id: user.id)) | ||
end | ||
end | ||
end |