user_toggles_whitespace_changes_spec.rb 705 Bytes
Newer Older
1 2 3 4 5 6
require 'rails_helper'

describe 'Merge request > User toggles whitespace changes', :js do
  let(:merge_request) { create(:merge_request) }
  let(:project) { merge_request.project }
  let(:user) { project.creator }
7 8

  before do
9 10
    project.add_master(user)
    sign_in(user)
11
    visit diffs_project_merge_request_path(project, merge_request)
12 13
  end

Alfredo Sumaran's avatar
Alfredo Sumaran committed
14
  it 'has a button to toggle whitespace changes' do
15
    expect(page).to have_content 'Hide whitespace changes'
16 17
  end

18
  describe 'clicking "Hide whitespace changes" button' do
Alfredo Sumaran's avatar
Alfredo Sumaran committed
19
    it 'toggles the "Hide whitespace changes" button' do
20 21 22
      click_link 'Hide whitespace changes'

      expect(page).to have_content 'Show whitespace changes'
23 24 25
    end
  end
end