2015-09-11 14:41:01 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Projects::BlameController do
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:project) { create(:project, :repository) }
|
2015-09-11 14:41:01 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
project.add_master(user)
|
2015-09-11 14:41:01 +05:30
|
|
|
controller.instance_variable_set(:@project, project)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET show" do
|
|
|
|
render_views
|
|
|
|
|
|
|
|
before do
|
|
|
|
get(:show,
|
2017-08-17 22:00:37 +05:30
|
|
|
namespace_id: project.namespace,
|
|
|
|
project_id: project,
|
2015-09-11 14:41:01 +05:30
|
|
|
id: id)
|
|
|
|
end
|
|
|
|
|
|
|
|
context "valid file" do
|
|
|
|
let(:id) { 'master/files/ruby/popen.rb' }
|
|
|
|
it { is_expected.to respond_with(:success) }
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
context "invalid file" do
|
|
|
|
let(:id) { 'master/files/ruby/missing_file.rb'}
|
2018-03-17 18:26:18 +05:30
|
|
|
it { expect(response).to have_gitlab_http_status(404) }
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
2015-09-11 14:41:01 +05:30
|
|
|
end
|
|
|
|
end
|