-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write a feature spec that goes into the actions_details partial as ad…
…d_role request type
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require 'browser_helper' | ||
|
||
RSpec.describe 'Requests', :js, :vcr, :beta do | ||
let(:submitter) { create(:confirmed_user, :with_home, login: 'kugelblitz') } | ||
let(:receiver) { create(:confirmed_user, :with_home, login: 'titan') } | ||
let(:target_project) { receiver.home_project } | ||
|
||
context 'for role addition user' do | ||
describe 'for projects' do | ||
it 'can be submitted' do | ||
login submitter | ||
visit project_show_path(project: target_project) | ||
desktop? ? click_link('Request Role Addition') : click_menu_link('Actions', 'Request Role Addition') | ||
choose 'Bugowner' | ||
choose 'User' | ||
fill_in 'User:', with: submitter.login.to_s | ||
fill_in 'Description:', with: 'I can fix bugs too.' | ||
expect { click_button('Request') }.to change(BsRequest, :count).by(1) | ||
expect(page).to have_text("#{submitter.realname} (#{submitter.login}) wants to get the role bugowner for project #{target_project}") | ||
expect(page).to have_css('#description-text', text: 'I can fix bugs too.') | ||
expect(page).to have_css('.badge', text: 'new') | ||
end | ||
end | ||
end | ||
end |