debian-mirror-gitlab/spec/views/projects/services/_form.haml_spec.rb

33 lines
931 B
Ruby
Raw Normal View History

2019-12-21 20:55:43 +05:30
# frozen_string_literal: true
2018-05-09 12:01:36 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe 'projects/services/_form' do
2018-05-09 12:01:36 +05:30
let(:project) { create(:redmine_project) }
let(:user) { create(:admin) }
before do
assign(:project, project)
allow(controller).to receive(:current_user).and_return(user)
2021-09-04 01:27:46 +05:30
allow(view).to receive_messages(
current_user: user,
can?: true,
current_application_settings: Gitlab::CurrentSettings.current_application_settings,
2021-09-30 23:02:18 +05:30
integration: project.redmine_integration,
2021-09-04 01:27:46 +05:30
request: double(referer: '/services')
)
2018-05-09 12:01:36 +05:30
end
context 'commit_events and merge_request_events' do
it 'display merge_request_events and commit_events descriptions' do
2021-09-04 01:27:46 +05:30
allow(Integrations::Redmine).to receive(:supported_events).and_return(%w(commit merge_request))
2018-05-09 12:01:36 +05:30
render
2020-06-23 00:09:42 +05:30
expect(rendered).to have_css("input[name='redirect_to'][value='/services']", count: 1, visible: false)
2018-05-09 12:01:36 +05:30
end
end
end