debian-mirror-gitlab/spec/features/merge_request/user_manages_subscription_spec.rb
2020-04-08 14:13:33 +05:30

34 lines
830 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe 'User manages subscription', :js do
let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
let(:user) { create(:user) }
before do
project.add_maintainer(user)
sign_in(user)
visit(merge_request_path(merge_request))
end
it 'toggles subscription' do
page.within('.js-issuable-subscribe-button') do
wait_for_requests
expect(page).to have_css 'button:not(.is-checked)'
find('button:not(.is-checked)').click
wait_for_requests
expect(page).to have_css 'button.is-checked'
find('button.is-checked').click
wait_for_requests
expect(page).to have_css 'button:not(.is-checked)'
end
end
end