8062380f60
This fixes an issue with Rails 5 and brings us up-to-date with the latest Devise release. This also replaces the deprecated Devise::TestHelpers with Devise::Test::ControllerHelpers. Changelog: https://github.com/plataformatec/devise/blob/v4.2.0/CHANGELOG.md#420---2016-07-01
28 lines
814 B
Ruby
28 lines
814 B
Ruby
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) }
|
|
let!(:deployment) do
|
|
create(:deployment, environment: environment, sha: project.commit('master').id)
|
|
end
|
|
|
|
before do
|
|
assign(:merge_request, merge_request)
|
|
assign(:project, project)
|
|
|
|
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
|