summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-12-04 12:55:23 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2015-12-11 18:02:09 +0100
commite80e3f5372d6bcad1fbe04a85b3086bb66794828 (patch)
tree16b1539cfd158ecac7fe05d595cbba30b8bc1a04 /spec/lib
parent8b4cdc50fca816b4f56f8579e17c4dba836ec797 (diff)
downloadgitlab-ce-e80e3f5372d6bcad1fbe04a85b3086bb66794828.tar.gz
Migrate CI::Project to Project
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/backend/grack_auth_spec.rb9
-rw-r--r--spec/lib/gitlab/build_data_builder_spec.rb4
2 files changed, 4 insertions, 9 deletions
diff --git a/spec/lib/gitlab/backend/grack_auth_spec.rb b/spec/lib/gitlab/backend/grack_auth_spec.rb
index 73458735ad9..2dd27464de7 100644
--- a/spec/lib/gitlab/backend/grack_auth_spec.rb
+++ b/spec/lib/gitlab/backend/grack_auth_spec.rb
@@ -191,15 +191,10 @@ describe Grack::Auth, lib: true do
context "when a gitlab ci token is provided" do
let(:token) { "123" }
- let(:gitlab_ci_project) { FactoryGirl.create :ci_project, token: token }
+ let(:project) { FactoryGirl.create :empty_project, token: token }
before do
- project.gitlab_ci_project = gitlab_ci_project
- project.save
-
- gitlab_ci_service = project.build_gitlab_ci_service
- gitlab_ci_service.active = true
- gitlab_ci_service.save
+ project.update_attributes(token: token, builds_enabled: true)
env["HTTP_AUTHORIZATION"] = ActionController::HttpAuthentication::Basic.encode_credentials("gitlab-ci-token", token)
end
diff --git a/spec/lib/gitlab/build_data_builder_spec.rb b/spec/lib/gitlab/build_data_builder_spec.rb
index af2de207eba..839b30f1ff4 100644
--- a/spec/lib/gitlab/build_data_builder_spec.rb
+++ b/spec/lib/gitlab/build_data_builder_spec.rb
@@ -14,7 +14,7 @@ describe 'Gitlab::BuildDataBuilder' do
it { expect(data[:tag]).to eq(build.tag) }
it { expect(data[:build_id]).to eq(build.id) }
it { expect(data[:build_status]).to eq(build.status) }
- it { expect(data[:project_id]).to eq(build.gl_project.id) }
- it { expect(data[:project_name]).to eq(build.gl_project.name_with_namespace) }
+ it { expect(data[:project_id]).to eq(build.project.id) }
+ it { expect(data[:project_name]).to eq(build.project.name_with_namespace) }
end
end