debian-mirror-gitlab/spec/views/projects/merge_requests/_commits.html.haml_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.1 KiB
Ruby
Raw Normal View History

2019-12-21 20:55:43 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe 'projects/merge_requests/_commits.html.haml', :sidekiq_might_not_need_inline do
2017-08-17 22:00:37 +05:30
include Devise::Test::ControllerHelpers
2018-03-17 18:26:18 +05:30
include ProjectForksHelper
2017-08-17 22:00:37 +05:30
let(:user) { create(:user) }
2018-03-17 18:26:18 +05:30
let(:target_project) { create(:project, :public, :repository) }
let(:source_project) { fork_project(target_project, user, repository: true) }
2017-08-17 22:00:37 +05:30
let(:merge_request) do
create(:merge_request, :simple,
source_project: source_project,
target_project: target_project,
author: user)
end
before do
controller.prepend_view_path('app/views/projects')
assign(:merge_request, merge_request)
2021-11-11 11:23:49 +05:30
assign(:commits, merge_request.commits(load_from_gitaly: true))
2018-11-20 20:47:30 +05:30
assign(:hidden_commit_count, 0)
2017-08-17 22:00:37 +05:30
end
it 'shows commits from source project' do
render
2018-03-17 18:26:18 +05:30
commit = merge_request.commits.first # HEAD
href = diffs_project_merge_request_path(target_project, merge_request, commit_id: commit)
2017-08-17 22:00:37 +05:30
2018-05-09 12:01:36 +05:30
expect(rendered).to have_link(href: href)
2017-08-17 22:00:37 +05:30
end
2018-11-20 20:47:30 +05:30
2021-11-11 11:23:49 +05:30
it 'shows signature verification badge' do
render
expect(rendered).to have_css('.gpg-status-box')
end
2017-08-17 22:00:37 +05:30
end