Add more tests for merge request versions feature

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2016-09-01 15:35:39 +03:00
parent 96b83a58cc
commit 45a984b80b
2 changed files with 26 additions and 3 deletions

View File

@ -12,7 +12,7 @@ feature 'Merge Request versions', js: true, feature: true do
it 'show the latest version of the diff' do
page.within '.mr-version-dropdown' do
expect(page).to have_content 'Version: latest'
expect(page).to have_content 'Latest: 5937ac0a'
end
expect(page).to have_content '8 changed files'
@ -33,6 +33,10 @@ feature 'Merge Request versions', js: true, feature: true do
expect(page).to have_content '5 changed files'
end
it 'show the message about disabled comments' do
expect(page).to have_content 'Comments are disabled'
end
end
describe 'compare with older version' do
@ -43,12 +47,22 @@ feature 'Merge Request versions', js: true, feature: true do
end
end
it 'should show older version' do
it 'should has correct value in the compare dropdown' do
page.within '.mr-version-compare-dropdown' do
expect(page).to have_content '6f6d7e7e'
end
end
expect(page).to have_content '5 changed files'
it 'show the message about disabled comments' do
expect(page).to have_content 'Comments are disabled'
end
it 'show diff between new and old version' do
expect(page).to have_content '4 changed files with 15 additions and 6 deletions'
end
it 'show diff between new and old version' do
expect(page).to have_content '4 changed files with 15 additions and 6 deletions'
end
end
end

View File

@ -0,0 +1,9 @@
require 'spec_helper'
describe GitHelper do
describe '#short_sha' do
let(:short_sha) { helper.short_sha('d4e043f6c20749a3ab3f4b8e23f2a8979f4b9100') }
it { expect(short_sha).to eq('d4e043f6') }
end
end