BigW Consortium Gitlab

toggle_whitespace_changes.rb 664 Bytes
Newer Older
1 2 3 4 5
require 'spec_helper'

feature 'Toggle Whitespace Changes', js: true, feature: true do
  before do
    login_as :admin
6 7
    merge_request = create(:merge_request)
    project = merge_request.source_project
8 9 10
    visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
  end

Alfredo Sumaran committed
11
  it 'has a button to toggle whitespace changes' do
12
    expect(page).to have_content 'Hide whitespace changes'
13 14
  end

15
  describe 'clicking "Hide whitespace changes" button' do
Alfredo Sumaran committed
16
    it 'toggles the "Hide whitespace changes" button' do
17 18 19
      click_link 'Hide whitespace changes'

      expect(page).to have_content 'Show whitespace changes'
20 21 22
    end
  end
end