Skip to content

Commit

Permalink
Write a feature spec that goes into the actions_details partial as ad…
Browse files Browse the repository at this point in the history
…d_role request type
  • Loading branch information
danidoni committed Feb 10, 2025
1 parent 3c4a62d commit 337d17d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/app/views/webui/request/_request_header.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
= render partial: 'actions_details', locals: { bs_request: bs_request, action: action,
prev_action: prev_action, next_action: next_action,
actions: actions, diff_to_superseded_id: diff_to_superseded_id,
page_name: page_name, notification_id: current_notification }
page_name: page_name, notification_id: current_notification,
current_notification: current_notification}
- if Flipper.enabled?(:labels, User.session)
.mt-4
= render partial: 'webui/shared/label', collection: bs_request.labels, as: :label
Expand Down
25 changes: 25 additions & 0 deletions src/api/spec/features/beta/webui/requests_spec.rb
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

0 comments on commit 337d17d

Please sign in to comment.