Fix feature specs on CI

MySQL's text column isn't big enough for the diffs in the
expand-collapse-diffs branch.
This commit is contained in:
Sean McGivern 2016-07-11 10:58:01 +01:00
parent 79a47582e8
commit 93ab686079
2 changed files with 21 additions and 22 deletions

View file

@ -5,12 +5,12 @@ feature 'Expand and collapse diffs', js: true, feature: true do
before do before do
login_as :admin login_as :admin
merge_request = create(:merge_request, target_branch: 'expand-collapse-diffs-start', source_branch: 'expand-collapse-diffs') project = create(:project)
project = merge_request.source_project branch = 'expand-collapse-diffs'
# Ensure that undiffable.md is in .gitattributes # Ensure that undiffable.md is in .gitattributes
project.repository.copy_gitattributes('expand-collapse-diffs') project.repository.copy_gitattributes(branch)
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request) visit namespace_project_commit_path(project.namespace, project, project.commit(branch))
execute_script('window.ajaxUris = []; $(document).ajaxSend(function(event, xhr, settings) { ajaxUris.push(settings.url) });') execute_script('window.ajaxUris = []; $(document).ajaxSend(function(event, xhr, settings) { ajaxUris.push(settings.url) });')
end end
@ -30,7 +30,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
define_method(file.split('.').first) { file_container(file) } define_method(file.split('.').first) { file_container(file) }
end end
context 'visiting an existing merge request' do context 'visiting a commit with collapsed diffs' do
it 'shows small diffs immediately' do it 'shows small diffs immediately' do
expect(small_diff).to have_selector('.code') expect(small_diff).to have_selector('.code')
expect(small_diff).not_to have_selector('.nothing-here-block') expect(small_diff).not_to have_selector('.nothing-here-block')
@ -74,13 +74,13 @@ feature 'Expand and collapse diffs', js: true, feature: true do
it 'shows the old content' do it 'shows the old content' do
old_line = large_diff_renamed.find('.line_content.old') old_line = large_diff_renamed.find('.line_content.old')
expect(old_line).to have_content('four copies') expect(old_line).to have_content('two copies')
end end
it 'shows the new content' do it 'shows the new content' do
new_line = large_diff_renamed.find('.line_content.new', match: :prefer_exact) new_line = large_diff_renamed.find('.line_content.new', match: :prefer_exact)
expect(new_line).to have_content('six copies') expect(new_line).to have_content('three copies')
end end
end end

View file

@ -18,8 +18,7 @@ module TestEnv
'orphaned-branch' => '45127a9', 'orphaned-branch' => '45127a9',
'binary-encoding' => '7b1cf43', 'binary-encoding' => '7b1cf43',
'gitattributes' => '5a62481', 'gitattributes' => '5a62481',
'expand-collapse-diffs-start' => '65b04e4', 'expand-collapse-diffs' => '4842455'
'expand-collapse-diffs' => '865e6d5'
} }
# gitlab-test-fork is a fork of gitlab-fork, but we don't necessarily # gitlab-test-fork is a fork of gitlab-fork, but we don't necessarily