2015-08-20 04:02:12 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Projects::BlameController do
|
2017-01-25 16:44:33 -05:00
|
|
|
let(:project) { create(:project, :repository) }
|
2015-08-20 04:02:12 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
|
2018-07-11 10:36:08 -04:00
|
|
|
project.add_maintainer(user)
|
2015-08-20 04:02:12 -04:00
|
|
|
controller.instance_variable_set(:@project, project)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET show" do
|
|
|
|
render_views
|
|
|
|
|
|
|
|
before do
|
|
|
|
get(:show,
|
2017-02-23 18:55:01 -05:00
|
|
|
namespace_id: project.namespace,
|
|
|
|
project_id: project,
|
2015-08-20 04:02:12 -04:00
|
|
|
id: id)
|
|
|
|
end
|
|
|
|
|
|
|
|
context "valid file" do
|
|
|
|
let(:id) { 'master/files/ruby/popen.rb' }
|
|
|
|
it { is_expected.to respond_with(:success) }
|
|
|
|
end
|
2016-12-16 10:10:04 -05:00
|
|
|
|
|
|
|
context "invalid file" do
|
|
|
|
let(:id) { 'master/files/ruby/missing_file.rb'}
|
2017-10-19 14:28:19 -04:00
|
|
|
it { expect(response).to have_gitlab_http_status(404) }
|
2016-12-16 10:10:04 -05:00
|
|
|
end
|
2015-08-20 04:02:12 -04:00
|
|
|
end
|
|
|
|
end
|