diff options
author | Rémy Coutable <remy@rymai.me> | 2018-08-30 17:18:01 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-08-30 17:18:01 +0200 |
commit | d004c768417ef95a4aecb58c6c241ceed1a73d8f (patch) | |
tree | 7dafc633b9592911af9657d22e0298e912a56c77 /spec/features/merge_request/user_views_diffs_spec.rb | |
parent | 418d35d97491af3921e8f5cca2734b0063c143a9 (diff) | |
download | gitlab-ce-d004c768417ef95a4aecb58c6c241ceed1a73d8f.tar.gz |
Reorganize issues and merge request feature specs in the same folder
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/features/merge_request/user_views_diffs_spec.rb')
-rw-r--r-- | spec/features/merge_request/user_views_diffs_spec.rb | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/spec/features/merge_request/user_views_diffs_spec.rb b/spec/features/merge_request/user_views_diffs_spec.rb new file mode 100644 index 00000000000..b1bfe9e5de3 --- /dev/null +++ b/spec/features/merge_request/user_views_diffs_spec.rb @@ -0,0 +1,58 @@ +require 'spec_helper' + +describe 'User views diffs', :js do + let(:merge_request) do + create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test') + end + let(:project) { create(:project, :public, :repository) } + + before do + visit(diffs_project_merge_request_path(project, merge_request)) + + wait_for_requests + end + + shared_examples 'unfold diffs' do + it 'unfolds diffs' do + first('.js-unfold').click + + expect(find('.file-holder[id="a5cc2925ca8258af241be7e5b0381edf30266302"] .text-file')).to have_content('.bundle') + end + end + + it 'shows diffs' do + expect(page).to have_css('.tab-content #diffs.active') + expect(page).to have_css('#parallel-diff-btn', count: 1) + expect(page).to have_css('#inline-diff-btn', count: 1) + end + + it 'hides loading spinner after load' do + expect(page).not_to have_selector('.mr-loading-status .loading', visible: true) + end + + context 'when in the inline view' do + include_examples 'unfold diffs' + end + + context 'when in the side-by-side view' do + before do + click_button 'Side-by-side' + + wait_for_requests + end + + it 'shows diffs in parallel' do + expect(page).to have_css('.parallel') + end + + it 'toggles container class' do + expect(page).not_to have_css('.content-wrapper > .container-fluid.container-limited') + + click_link 'Commits' + + expect(page).to have_css('.content-wrapper > .container-fluid.container-limited') + end + + include_examples 'unfold diffs' + end +end |