2016-09-13 17:45:13 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'projects/merge_requests/widget/_heading' do
|
|
|
|
include Devise::TestHelpers
|
|
|
|
|
|
|
|
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) }
|
|
|
|
let!(:deployment) do
|
|
|
|
create(:deployment, environment: environment, sha: project.commit('master').id)
|
|
|
|
end
|
|
|
|
|
|
|
|
before do
|
|
|
|
assign(:merge_request, merge_request)
|
|
|
|
assign(:project, project)
|
|
|
|
|
2016-09-29 09:46:39 +05:30
|
|
|
allow(view).to receive(:can?).and_return(true)
|
|
|
|
|
2016-09-13 17:45:13 +05:30
|
|
|
render
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'displays that the environment is deployed' do
|
|
|
|
expect(rendered).to match("Deployed to")
|
|
|
|
expect(rendered).to match("#{environment.name}")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|