debian-mirror-gitlab/spec/features/merge_request/user_manages_subscription_spec.rb
2019-10-12 21:52:04 +05:30

32 lines
805 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
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