2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
require 'spec_helper'
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'Merge request > User toggles whitespace changes', :js do
|
2018-03-17 18:26:18 +05:30
|
|
|
let(:merge_request) { create(:merge_request) }
|
|
|
|
let(:project) { merge_request.project }
|
|
|
|
let(:user) { project.creator }
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
before do
|
2018-11-18 11:00:15 +05:30
|
|
|
project.add_maintainer(user)
|
2018-03-17 18:26:18 +05:30
|
|
|
sign_in(user)
|
2017-09-10 17:25:29 +05:30
|
|
|
visit diffs_project_merge_request_path(project, merge_request)
|
2019-03-02 22:35:43 +05:30
|
|
|
|
|
|
|
find('.js-show-diff-settings').click
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'has a button to toggle whitespace changes' do
|
2019-03-02 22:35:43 +05:30
|
|
|
expect(page).to have_content 'Show whitespace changes'
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
describe 'clicking "Hide whitespace changes" button' do
|
|
|
|
it 'toggles the "Hide whitespace changes" button' do
|
2019-03-02 22:35:43 +05:30
|
|
|
find('#show-whitespace').click
|
|
|
|
|
|
|
|
visit diffs_project_merge_request_path(project, merge_request)
|
|
|
|
|
|
|
|
find('.js-show-diff-settings').click
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2019-03-02 22:35:43 +05:30
|
|
|
expect(find('#show-whitespace')).to be_checked
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|