debian-mirror-gitlab/spec/controllers/projects/badges_controller_spec.rb

29 lines
663 B
Ruby
Raw Normal View History

2017-09-10 17:25:29 +05:30
require 'spec_helper'
describe Projects::BadgesController do
let(:project) { pipeline.project }
let!(:pipeline) { create(:ci_empty_pipeline) }
let(:user) { create(:user) }
before do
project.add_master(user)
sign_in(user)
end
it 'requests the pipeline badge successfully' do
get_badge(:pipeline)
2018-03-17 18:26:18 +05:30
expect(response).to have_gitlab_http_status(:ok)
2017-09-10 17:25:29 +05:30
end
it 'requests the coverage badge successfully' do
get_badge(:coverage)
2018-03-17 18:26:18 +05:30
expect(response).to have_gitlab_http_status(:ok)
2017-09-10 17:25:29 +05:30
end
def get_badge(badge)
get badge, namespace_id: project.namespace.to_param, project_id: project, ref: pipeline.ref, format: :svg
end
end