rspec test fixes

This commit is contained in:
Phil Hughes 2017-09-04 19:23:57 +01:00
parent 38f1551452
commit 3b1993a83e
3 changed files with 7 additions and 10 deletions

View file

@ -166,12 +166,10 @@ describe 'New/edit issue', :js do
end
end
page.within '.issuable-meta' do
page.within '.breadcrumbs' do
issue = Issue.find_by(title: 'title')
expect(page).to have_text("Issue #{issue.to_reference}")
# compare paths because the host differ in test
expect(find_link(issue.to_reference)[:href]).to end_with(issue_path(issue))
expect(page).to have_text("Issues #{issue.to_reference}")
end
end

View file

@ -84,13 +84,10 @@ describe 'New/edit merge request', :js do
end
end
page.within '.issuable-meta' do
page.within '.breadcrumbs' do
merge_request = MergeRequest.find_by(source_branch: 'fix')
expect(page).to have_text("Merge request #{merge_request.to_reference}")
# compare paths because the host differ in test
expect(find_link(merge_request.to_reference)[:href])
.to end_with(merge_request_path(merge_request))
expect(page).to have_text("Merge Requests #{merge_request.to_reference}")
end
end

View file

@ -91,7 +91,9 @@ describe GroupsHelper do
let!(:very_deep_nested_group) { create(:group, parent: deep_nested_group) }
it 'outputs the groups in the correct order' do
expect(helper.group_title(very_deep_nested_group)).to match(/>#{group.name}<\/a>.*>#{nested_group.name}<\/a>.*>#{deep_nested_group.name}<\/a>/)
expect(helper.group_title(very_deep_nested_group))
.to match(/<li style="text-indent: 16px;"><a.*>#{deep_nested_group.name}.*<\/li>.*<a.*>#{very_deep_nested_group.name}<\/a>/m)
# expect(helper.group_title(very_deep_nested_group)).to match(/<\/li>.*<a.*>#{very_deep_nested_group.name}<\/a>/)
end
end
end