summaryrefslogtreecommitdiff
path: root/spec/features/projects/commit/diff_notes_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/commit/diff_notes_spec.rb')
-rw-r--r--spec/features/projects/commit/diff_notes_spec.rb39
1 files changed, 22 insertions, 17 deletions
diff --git a/spec/features/projects/commit/diff_notes_spec.rb b/spec/features/projects/commit/diff_notes_spec.rb
index ff86047d812..6cebff1cc9a 100644
--- a/spec/features/projects/commit/diff_notes_spec.rb
+++ b/spec/features/projects/commit/diff_notes_spec.rb
@@ -8,30 +8,35 @@ RSpec.describe 'Commit diff', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public, :repository) }
- before do
- project.add_maintainer(user)
- sign_in user
+ using RSpec::Parameterized::TableSyntax
+
+ where(:view, :async_diff_file_loading) do
+ 'inline' | true
+ 'inline' | false
+ 'parallel' | true
+ 'parallel' | false
end
- %w(inline parallel).each do |view|
- context "#{view} view" do
- before do
- visit project_commit_path(project, sample_commit.id, view: view)
- end
+ with_them do
+ before do
+ stub_feature_flags(async_commit_diff_files: async_diff_file_loading)
+ project.add_maintainer(user)
+ sign_in user
+ visit project_commit_path(project, sample_commit.id, view: view)
+ end
- it "adds comment to diff" do
- diff_line_num = first('.diff-line-num.new')
+ it "adds comment to diff" do
+ diff_line_num = first('.diff-line-num.new')
- diff_line_num.hover
- diff_line_num.find('.js-add-diff-note-button').click
+ diff_line_num.hover
+ diff_line_num.find('.js-add-diff-note-button').click
- page.within(first('.diff-viewer')) do
- find('.js-note-text').set 'test comment'
+ page.within(first('.diff-viewer')) do
+ find('.js-note-text').set 'test comment'
- click_button 'Comment'
+ click_button 'Comment'
- expect(page).to have_content('test comment')
- end
+ expect(page).to have_content('test comment')
end
end
end