Commit 3df9efbd authored by Mark Lapierre's avatar Mark Lapierre

Merge branch '325784-spec-for-similar-name-ref-switch' into 'master'

Add feature spec to cover ref switch of similar name

See merge request gitlab-org/gitlab!60182
parents 8a917526 40f1bc48
......@@ -125,6 +125,7 @@ RSpec.describe 'File blob', :js do
page.within '.project-refs-form' do
click_link ref_name
wait_for_requests
end
end
......@@ -170,6 +171,27 @@ RSpec.describe 'File blob', :js do
expect(page).not_to have_css('.hll')
end
end
context 'sucessfully change ref of similar name' do
before do
project.repository.create_branch('dev')
project.repository.create_branch('development')
end
it 'switch ref from longer to shorter ref name' do
visit_blob('files/js/application.js', ref: 'development')
switch_ref_to('dev')
expect(page.find('.file-title-name').text).to eq('application.js')
end
it 'switch ref from shorter to longer ref name' do
visit_blob('files/js/application.js', ref: 'dev')
switch_ref_to('development')
expect(page.find('.file-title-name').text).to eq('application.js')
end
end
end
context 'visiting with a line number anchor' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment