gitlab-org--gitlab-foss/spec/views/projects/merge_requests/_heading.html.haml_spec.rb

29 lines
814 B
Ruby
Raw Normal View History

require 'spec_helper'
describe 'projects/merge_requests/widget/_heading' do
include Devise::Test::ControllerHelpers
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
create(:deployment, environment: environment, sha: project.commit('master').id)
2016-08-03 07:37:39 -04:00
end
before do
assign(:merge_request, merge_request)
assign(:project, project)
2016-09-21 07:13:50 -04:00
allow(view).to receive(:can?).and_return(true)
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