2016-08-03 04:22:01 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'projects/merge_requests/widget/_heading' do
|
2016-09-21 19:06:33 -04:00
|
|
|
include Devise::Test::ControllerHelpers
|
2016-08-03 04:22:01 -04:00
|
|
|
|
|
|
|
context 'when released to an environment' do
|
|
|
|
let(:project) { merge_request.target_project }
|
|
|
|
let(:merge_request) { create(:merge_request, :merged) }
|
|
|
|
let(:environment) { create(:environment, project: project) }
|
2016-08-03 07:37:39 -04:00
|
|
|
let!(:deployment) do
|
2016-08-09 09:11:14 -04:00
|
|
|
create(:deployment, environment: environment, sha: project.commit('master').id)
|
2016-08-03 07:37:39 -04:00
|
|
|
end
|
2016-08-03 04:22:01 -04:00
|
|
|
|
|
|
|
before do
|
|
|
|
assign(:merge_request, merge_request)
|
2016-08-09 09:11:14 -04:00
|
|
|
assign(:project, project)
|
2016-08-03 04:22:01 -04:00
|
|
|
|
2016-09-21 07:13:50 -04:00
|
|
|
allow(view).to receive(:can?).and_return(true)
|
|
|
|
|
2016-08-03 04:22:01 -04:00
|
|
|
render
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'displays that the environment is deployed' do
|
2016-08-09 09:11:14 -04:00
|
|
|
expect(rendered).to match("Deployed to")
|
|
|
|
expect(rendered).to match("#{environment.name}")
|
2016-08-03 04:22:01 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|