Add proper tests
This commit is contained in:
parent
3918c303b9
commit
efc4e8dda9
1 changed files with 31 additions and 0 deletions
|
@ -492,6 +492,37 @@ feature 'Builds', :feature do
|
|||
|
||||
it { expect(page.status_code).to eq(404) }
|
||||
end
|
||||
|
||||
context "when Project is public and builds_access_level is Everyone with access" do
|
||||
let(:project) { create(:project, :public) }
|
||||
before do
|
||||
project.project_feature.update_attribute('builds_access_level', ProjectFeature::ENABLED)
|
||||
end
|
||||
|
||||
context "when user belongs to the project" do
|
||||
before do
|
||||
visit trace_namespace_project_build_path(project.namespace, project, build, format: :json)
|
||||
end
|
||||
|
||||
it 'traces build log' do
|
||||
expect(page.status_code).to eq(200)
|
||||
end
|
||||
end
|
||||
|
||||
context "when user does not belong to the project" do
|
||||
let(:non_member) { create(:user) }
|
||||
|
||||
before do
|
||||
logout # Logout from :developer
|
||||
login_as(non_member)
|
||||
visit trace_namespace_project_build_path(project.namespace, project, build, format: :json)
|
||||
end
|
||||
|
||||
it 'traces build log' do
|
||||
expect(page.status_code).to eq(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET /:project/builds/:id/status" do
|
||||
|
|
Loading…
Reference in a new issue