|
|
@ -35,10 +35,11 @@ describe RepositoriesController, type: :controller do |
|
|
|
allow(Project).to receive(:find).and_return(project) |
|
|
|
allow(Project).to receive(:find).and_return(project) |
|
|
|
project |
|
|
|
project |
|
|
|
end |
|
|
|
end |
|
|
|
let(:user) { |
|
|
|
let(:user) do |
|
|
|
FactoryGirl.create(:user, member_in_project: project, |
|
|
|
FactoryGirl.create(:user, member_in_project: project, |
|
|
|
member_through_role: role) |
|
|
|
member_through_role: role) |
|
|
|
} |
|
|
|
end |
|
|
|
|
|
|
|
let(:role) { FactoryGirl.create(:role, permissions: []) } |
|
|
|
let (:url) { 'file:///tmp/something/does/not/exist.svn' } |
|
|
|
let (:url) { 'file:///tmp/something/does/not/exist.svn' } |
|
|
|
|
|
|
|
|
|
|
|
let(:repository) do |
|
|
|
let(:repository) do |
|
|
@ -167,7 +168,7 @@ describe RepositoriesController, type: :controller do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
describe 'with filesystem repository' do |
|
|
|
describe 'with subversion repository' do |
|
|
|
with_subversion_repository do |repo_dir| |
|
|
|
with_subversion_repository do |repo_dir| |
|
|
|
let(:root_url) { repo_dir } |
|
|
|
let(:root_url) { repo_dir } |
|
|
|
let(:url) { "file://#{root_url}" } |
|
|
|
let(:url) { "file://#{root_url}" } |
|
|
@ -332,4 +333,22 @@ describe RepositoriesController, type: :controller do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe 'when not being logged in' do |
|
|
|
|
|
|
|
let(:anonymous) { FactoryGirl.build_stubbed(:anonymous) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
login_as(anonymous) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe '#show' do |
|
|
|
|
|
|
|
it 'redirects to login while preserving the path' do |
|
|
|
|
|
|
|
params = { path: 'aDir/within/aDir', rev: '42', project_id: project.id } |
|
|
|
|
|
|
|
get :show, params: params |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(response) |
|
|
|
|
|
|
|
.to redirect_to signin_path(back_url: show_revisions_path_project_repository_url(params)) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|