diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-09 13:37:50 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-09 13:37:50 +0200 |
commit | 76c6aeb9bc9855e9a65bb08db862e92ac923255e (patch) | |
tree | 3494f9854f8f9e2c14f909c7132691f652d13ebc | |
parent | 3d6fed54f0dc551d8c7ba9a03f4dfbd2203552b5 (diff) | |
download | gitlab-ce-76c6aeb9bc9855e9a65bb08db862e92ac923255e.tar.gz |
Merge CI factories and CI spec/support with GitLab
-rw-r--r-- | app/controllers/ci/application_controller.rb | 2 | ||||
-rw-r--r-- | db/schema.rb | 144 | ||||
-rw-r--r-- | spec/ci/factories/users.rb | 6 | ||||
-rw-r--r-- | spec/ci/spec_helper.rb | 60 | ||||
-rw-r--r-- | spec/ci/support/api_helpers.rb | 35 | ||||
-rw-r--r-- | spec/ci/support/db_cleaner.rb | 39 | ||||
-rw-r--r-- | spec/ci/support/login_helpers.rb | 22 | ||||
-rw-r--r-- | spec/ci/support/monkey_patches/oauth2.rb | 7 | ||||
-rw-r--r-- | spec/controllers/ci/commits_controller_spec.rb (renamed from spec/ci/controllers/commits_controller_spec.rb) | 8 | ||||
-rw-r--r-- | spec/controllers/ci/projects_controller_spec.rb (renamed from spec/ci/controllers/projects_controller_spec.rb) | 0 | ||||
-rw-r--r-- | spec/factories/ci/builds.rb (renamed from spec/ci/factories/builds.rb) | 2 | ||||
-rw-r--r-- | spec/factories/ci/commits.rb (renamed from spec/ci/factories/commits.rb) | 8 | ||||
-rw-r--r-- | spec/factories/ci/events.rb (renamed from spec/ci/factories/events.rb) | 2 | ||||
-rw-r--r-- | spec/factories/ci/projects.rb (renamed from spec/ci/factories/projects.rb) | 6 | ||||
-rw-r--r-- | spec/factories/ci/runner_projects.rb (renamed from spec/ci/factories/runner_projects.rb) | 2 | ||||
-rw-r--r-- | spec/factories/ci/runners.rb (renamed from spec/ci/factories/runners.rb) | 2 | ||||
-rw-r--r-- | spec/factories/ci/trigger_requests.rb (renamed from spec/ci/factories/trigger_requests.rb) | 0 | ||||
-rw-r--r-- | spec/factories/ci/triggers.rb (renamed from spec/ci/factories/triggers.rb) | 2 | ||||
-rw-r--r-- | spec/factories/ci/web_hook.rb (renamed from spec/ci/factories/web_hook.rb) | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 3 | ||||
-rw-r--r-- | spec/support/gitlab_stubs/gitlab_ci.yml (renamed from spec/ci/support/gitlab_stubs/gitlab_ci.yml) | 0 | ||||
-rw-r--r-- | spec/support/gitlab_stubs/project_8.json (renamed from spec/ci/support/gitlab_stubs/project_8.json) | 0 | ||||
-rw-r--r-- | spec/support/gitlab_stubs/project_8_hooks.json (renamed from spec/ci/support/gitlab_stubs/project_8_hooks.json) | 0 | ||||
-rw-r--r-- | spec/support/gitlab_stubs/projects.json (renamed from spec/ci/support/gitlab_stubs/projects.json) | 0 | ||||
-rw-r--r-- | spec/support/gitlab_stubs/raw_project.yml (renamed from spec/ci/support/gitlab_stubs/raw_project.yml) | 0 | ||||
-rw-r--r-- | spec/support/gitlab_stubs/session.json (renamed from spec/ci/support/gitlab_stubs/session.json) | 0 | ||||
-rw-r--r-- | spec/support/gitlab_stubs/user.json (renamed from spec/ci/support/gitlab_stubs/user.json) | 0 | ||||
-rw-r--r-- | spec/support/setup_builds_storage.rb (renamed from spec/ci/support/setup_builds_storage.rb) | 0 | ||||
-rw-r--r-- | spec/support/stub_gitlab_calls.rb (renamed from spec/ci/support/stub_gitlab_calls.rb) | 0 | ||||
-rw-r--r-- | spec/support/stub_gitlab_data.rb (renamed from spec/ci/support/stub_gitlab_data.rb) | 0 |
30 files changed, 59 insertions, 293 deletions
diff --git a/app/controllers/ci/application_controller.rb b/app/controllers/ci/application_controller.rb index 726781cb30b..95390d09737 100644 --- a/app/controllers/ci/application_controller.rb +++ b/app/controllers/ci/application_controller.rb @@ -8,7 +8,7 @@ module Ci rescue_from Ci::Network::UnauthorizedError, with: :invalid_token before_filter :default_headers - before_filter :check_config + #before_filter :check_config protect_from_forgery diff --git a/db/schema.rb b/db/schema.rb index 77ced9caa3c..d7197d951a4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -24,17 +24,6 @@ ActiveRecord::Schema.define(version: 20150826001931) do t.datetime "updated_at" end - create_table "appearances", force: true do |t| - t.string "title" - t.text "description" - t.string "logo" - t.integer "updated_by" - t.datetime "created_at" - t.datetime "updated_at" - t.string "dark_logo" - t.string "light_logo" - end - create_table "application_settings", force: true do |t| t.integer "default_projects_limit" t.boolean "signup_enabled" @@ -46,11 +35,10 @@ ActiveRecord::Schema.define(version: 20150826001931) do t.string "home_page_url" t.integer "default_branch_protection", default: 2 t.boolean "twitter_sharing_enabled", default: true - t.text "help_text" t.text "restricted_visibility_levels" + t.boolean "version_check_enabled", default: true t.integer "max_attachment_size", default: 10, null: false t.integer "default_project_visibility" - t.boolean "version_check_enabled", default: true t.integer "default_snippet_visibility" t.text "restricted_signup_domains" t.boolean "user_oauth_applications", default: true @@ -318,28 +306,6 @@ ActiveRecord::Schema.define(version: 20150826001931) do add_index "forked_project_links", ["forked_to_project_id"], name: "index_forked_project_links_on_forked_to_project_id", unique: true, using: :btree - create_table "git_hooks", force: true do |t| - t.string "force_push_regex" - t.string "delete_branch_regex" - t.string "commit_message_regex" - t.boolean "deny_delete_tag" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "author_email_regex" - t.boolean "member_check", default: false, null: false - t.string "file_name_regex" - t.boolean "is_sample", default: false - t.integer "max_file_size", default: 0 - end - - create_table "historical_data", force: true do |t| - t.date "date", null: false - t.integer "active_user_count" - t.datetime "created_at" - t.datetime "updated_at" - end - create_table "identities", force: true do |t| t.string "extern_uid" t.string "provider" @@ -411,21 +377,6 @@ ActiveRecord::Schema.define(version: 20150826001931) do add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree - create_table "ldap_group_links", force: true do |t| - t.string "cn", null: false - t.integer "group_access", null: false - t.integer "group_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.string "provider" - end - - create_table "licenses", force: true do |t| - t.text "data", null: false - t.datetime "created_at" - t.datetime "updated_at" - end - create_table "members", force: true do |t| t.integer "access_level", null: false t.integer "source_id", null: false @@ -507,19 +458,18 @@ ActiveRecord::Schema.define(version: 20150826001931) do add_index "milestones", ["project_id"], name: "index_milestones_on_project_id", using: :btree create_table "namespaces", force: true do |t| - t.string "name", null: false - t.string "path", null: false + t.string "name", null: false + t.string "path", null: false t.integer "owner_id" t.datetime "created_at" t.datetime "updated_at" t.string "type" - t.string "description", default: "", null: false + t.string "description", default: "", null: false t.string "avatar" - t.boolean "membership_lock", default: false end add_index "namespaces", ["created_at", "id"], name: "index_namespaces_on_created_at_and_id", using: :btree - add_index "namespaces", ["name"], name: "index_namespaces_on_name", using: :btree + add_index "namespaces", ["name"], name: "index_namespaces_on_name", unique: true, using: :btree add_index "namespaces", ["owner_id"], name: "index_namespaces_on_owner_id", using: :btree add_index "namespaces", ["path"], name: "index_namespaces_on_path", unique: true, using: :btree add_index "namespaces", ["type"], name: "index_namespaces_on_type", using: :btree @@ -593,14 +543,6 @@ ActiveRecord::Schema.define(version: 20150826001931) do add_index "oauth_applications", ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type", using: :btree add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree - create_table "project_group_links", force: true do |t| - t.integer "project_id", null: false - t.integer "group_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.integer "group_access", default: 30, null: false - end - create_table "project_import_data", force: true do |t| t.integer "project_id" t.text "data" @@ -613,28 +555,25 @@ ActiveRecord::Schema.define(version: 20150826001931) do t.datetime "created_at" t.datetime "updated_at" t.integer "creator_id" - t.boolean "issues_enabled", default: true, null: false - t.boolean "wall_enabled", default: true, null: false - t.boolean "merge_requests_enabled", default: true, null: false - t.boolean "wiki_enabled", default: true, null: false + t.boolean "issues_enabled", default: true, null: false + t.boolean "wall_enabled", default: true, null: false + t.boolean "merge_requests_enabled", default: true, null: false + t.boolean "wiki_enabled", default: true, null: false t.integer "namespace_id" - t.string "issues_tracker", default: "gitlab", null: false + t.string "issues_tracker", default: "gitlab", null: false t.string "issues_tracker_id" - t.boolean "snippets_enabled", default: true, null: false + t.boolean "snippets_enabled", default: true, null: false t.datetime "last_activity_at" t.string "import_url" - t.integer "visibility_level", default: 0, null: false - t.boolean "archived", default: false, null: false + t.integer "visibility_level", default: 0, null: false + t.boolean "archived", default: false, null: false t.string "avatar" t.string "import_status" - t.float "repository_size", default: 0.0 - t.integer "star_count", default: 0, null: false + t.float "repository_size", default: 0.0 + t.integer "star_count", default: 0, null: false t.string "import_type" t.string "import_source" - t.text "merge_requests_template" - t.boolean "merge_requests_rebase_enabled", default: false - t.boolean "merge_requests_rebase_default", default: true - t.integer "commit_count", default: 0 + t.integer "commit_count", default: 0 end add_index "projects", ["created_at", "id"], name: "index_projects_on_created_at_and_id", using: :btree @@ -734,19 +673,13 @@ ActiveRecord::Schema.define(version: 20150826001931) do add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree - create_table "test", id: false, force: true do |t| - t.integer "col" - end - - add_index "test", ["col"], name: "index_name", unique: true, using: :btree - create_table "users", force: true do |t| - t.string "email", default: "", null: false - t.string "encrypted_password", default: "", null: false + t.string "email", default: "", null: false + t.string "encrypted_password", default: "", null: false t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0 + t.integer "sign_in_count", default: 0 t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" t.string "current_sign_in_ip" @@ -754,22 +687,22 @@ ActiveRecord::Schema.define(version: 20150826001931) do t.datetime "created_at" t.datetime "updated_at" t.string "name" - t.boolean "admin", default: false, null: false - t.integer "projects_limit", default: 10 - t.string "skype", default: "", null: false - t.string "linkedin", default: "", null: false - t.string "twitter", default: "", null: false + t.boolean "admin", default: false, null: false + t.integer "projects_limit", default: 10 + t.string "skype", default: "", null: false + t.string "linkedin", default: "", null: false + t.string "twitter", default: "", null: false t.string "authentication_token" - t.integer "theme_id", default: 1, null: false + t.integer "theme_id", default: 1, null: false t.string "bio" - t.integer "failed_attempts", default: 0 + t.integer "failed_attempts", default: 0 t.datetime "locked_at" t.string "username" - t.boolean "can_create_group", default: true, null: false - t.boolean "can_create_team", default: true, null: false + t.boolean "can_create_group", default: true, null: false + t.boolean "can_create_team", default: true, null: false t.string "state" - t.integer "color_scheme_id", default: 1, null: false - t.integer "notification_level", default: 1, null: false + t.integer "color_scheme_id", default: 1, null: false + t.integer "notification_level", default: 1, null: false t.datetime "password_expires_at" t.integer "created_by_id" t.datetime "last_credential_check_at" @@ -778,21 +711,20 @@ ActiveRecord::Schema.define(version: 20150826001931) do t.datetime "confirmed_at" t.datetime "confirmation_sent_at" t.string "unconfirmed_email" - t.boolean "hide_no_ssh_key", default: false - t.string "website_url", default: "", null: false + t.boolean "hide_no_ssh_key", default: false + t.string "website_url", default: "", null: false t.string "notification_email" - t.boolean "hide_no_password", default: false - t.boolean "password_automatically_set", default: false - t.datetime "admin_email_unsubscribed_at" + t.boolean "hide_no_password", default: false + t.boolean "password_automatically_set", default: false t.string "location" - t.string "public_email", default: "", null: false t.string "encrypted_otp_secret" t.string "encrypted_otp_secret_iv" t.string "encrypted_otp_secret_salt" - t.boolean "otp_required_for_login", default: false, null: false + t.boolean "otp_required_for_login", default: false, null: false t.text "otp_backup_codes" - t.integer "dashboard", default: 0 - t.integer "project_view", default: 0 + t.string "public_email", default: "", null: false + t.integer "dashboard", default: 0 + t.integer "project_view", default: 0 end add_index "users", ["admin"], name: "index_users_on_admin", using: :btree diff --git a/spec/ci/factories/users.rb b/spec/ci/factories/users.rb deleted file mode 100644 index 26b30eff0e6..00000000000 --- a/spec/ci/factories/users.rb +++ /dev/null @@ -1,6 +0,0 @@ -# Read about factories at https://github.com/thoughtbot/factory_girl - -FactoryGirl.define do - factory :user do - end -end diff --git a/spec/ci/spec_helper.rb b/spec/ci/spec_helper.rb deleted file mode 100644 index 54d3068845d..00000000000 --- a/spec/ci/spec_helper.rb +++ /dev/null @@ -1,60 +0,0 @@ -if ENV['SIMPLECOV'] - require 'simplecov' - SimpleCov.start -end - -if ENV['COVERALLS'] - require 'coveralls' - Coveralls.wear!('rails') -end - -ENV["RAILS_ENV"] ||= 'test' -require File.expand_path("../../config/environment", __FILE__) -require 'rspec/rails' -require 'rspec/autorun' -require 'sidekiq/testing/inline' -require 'capybara/poltergeist' - -Capybara.javascript_driver = :poltergeist -Capybara.default_wait_time = 10 - -# Requires supporting ruby files with custom matchers and macros, etc, -# in spec/support/ and its subdirectories. -Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} - -require 'webmock/rspec' -WebMock.disable_net_connect!(allow_localhost: true) - -RSpec.configure do |config| - config.include LoginHelpers, type: :feature - - config.include StubGitlabCalls - config.include StubGitlabData - - # ## Mock Framework - # - # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: - # - # config.mock_with :mocha - # config.mock_with :flexmock - # config.mock_with :rr - - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" - - # If you're not using ActiveRecord, or you'd prefer not to run each of your - # examples within a transaction, remove the following line or assign false - # instead of true. - config.use_transactional_fixtures = false - - # If true, the base class of anonymous controllers will be inferred - # automatically. This will be the default behavior in future versions of - # rspec-rails. - config.infer_base_class_for_anonymous_controllers = false - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = "random" -end diff --git a/spec/ci/support/api_helpers.rb b/spec/ci/support/api_helpers.rb deleted file mode 100644 index 555980f2ea7..00000000000 --- a/spec/ci/support/api_helpers.rb +++ /dev/null @@ -1,35 +0,0 @@ -module ApiHelpers - # Public: Prepend a request path with the path to the API - # - # path - Path to append - # user - User object - If provided, automatically appends private_token query - # string for authenticated requests - # - # Examples - # - # >> api('/issues') - # => "/api/v2/issues" - # - # >> api('/issues', User.last) - # => "/api/v2/issues?private_token=..." - # - # >> api('/issues?foo=bar', User.last) - # => "/api/v2/issues?foo=bar&private_token=..." - # - # Returns the relative path to the requested API resource - def api(path, user = nil) - "/api/#{API::API.version}#{path}" + - - # Normalize query string - (path.index('?') ? '' : '?') + - - # Append private_token if given a User object - (user.respond_to?(:private_token) ? - "&private_token=#{user.private_token}" : "") - end - - def json_response - JSON.parse(response.body) - end - -end diff --git a/spec/ci/support/db_cleaner.rb b/spec/ci/support/db_cleaner.rb deleted file mode 100644 index d2d532d9738..00000000000 --- a/spec/ci/support/db_cleaner.rb +++ /dev/null @@ -1,39 +0,0 @@ -# RSpec.configure do |config| - -# config.around(:each) do |example| -# DatabaseCleaner.strategy = :transaction -# DatabaseCleaner.clean_with(:truncation) -# DatabaseCleaner.cleaning do -# example.run -# end -# end - -# config.around(:each, js: true) do |example| -# DatabaseCleaner.strategy = :truncation -# DatabaseCleaner.clean_with(:truncation) -# DatabaseCleaner.cleaning do -# example.run -# end -# end -# end -RSpec.configure do |config| - config.before(:suite) do - DatabaseCleaner.clean_with(:truncation) - end - - config.before(:each) do - DatabaseCleaner.strategy = :transaction - end - - config.before(:each, :js => true) do - DatabaseCleaner.strategy = :truncation - end - - config.before(:each) do - DatabaseCleaner.start - end - - config.after(:each) do - DatabaseCleaner.clean - end -end diff --git a/spec/ci/support/login_helpers.rb b/spec/ci/support/login_helpers.rb deleted file mode 100644 index ebd9693f8a4..00000000000 --- a/spec/ci/support/login_helpers.rb +++ /dev/null @@ -1,22 +0,0 @@ -module LoginHelpers - def login_as(role) - raise 'Only :user allowed' unless role == :user - stub_gitlab_calls - login_with(:user) - end - - # Internal: Login as the specified user - # - # user - User instance to login with - def login_with(user) - visit callback_user_sessions_path(code: "some_auth_code_here") - end - - def logout - click_link "Logout" rescue nil - end - - def skip_admin_auth - ApplicationController.any_instance.stub(authenticate_admin!: true) - end -end diff --git a/spec/ci/support/monkey_patches/oauth2.rb b/spec/ci/support/monkey_patches/oauth2.rb deleted file mode 100644 index dfd5e319f00..00000000000 --- a/spec/ci/support/monkey_patches/oauth2.rb +++ /dev/null @@ -1,7 +0,0 @@ -module OAuth2 - class Client - def get_token(params, access_token_opts = {}, access_token_class = AccessToken) - OpenStruct.new(token: "some_token") - end - end -end
\ No newline at end of file diff --git a/spec/ci/controllers/commits_controller_spec.rb b/spec/controllers/ci/commits_controller_spec.rb index f32d6f8c126..b71e7505731 100644 --- a/spec/ci/controllers/commits_controller_spec.rb +++ b/spec/controllers/ci/commits_controller_spec.rb @@ -1,13 +1,13 @@ require "spec_helper" -describe CommitsController do +describe Ci::CommitsController do before do - @project = FactoryGirl.create :project + @project = FactoryGirl.create :ci_project end describe "GET /status" do it "returns status of commit" do - commit = FactoryGirl.create :commit, project: @project + commit = FactoryGirl.create :ci_commit, project: @project get :status, id: commit.sha, ref_id: commit.ref, project_id: @project.id expect(response).to be_success @@ -16,7 +16,7 @@ describe CommitsController do end it "returns not_found status" do - commit = FactoryGirl.create :commit, project: @project + commit = FactoryGirl.create :ci_commit, project: @project get :status, id: commit.sha, ref_id: "deploy", project_id: @project.id expect(response).to be_success diff --git a/spec/ci/controllers/projects_controller_spec.rb b/spec/controllers/ci/projects_controller_spec.rb index 0069a782511..0069a782511 100644 --- a/spec/ci/controllers/projects_controller_spec.rb +++ b/spec/controllers/ci/projects_controller_spec.rb diff --git a/spec/ci/factories/builds.rb b/spec/factories/ci/builds.rb index 346e0002bf5..35a84b1e6eb 100644 --- a/spec/ci/factories/builds.rb +++ b/spec/factories/ci/builds.rb @@ -26,7 +26,7 @@ # Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do - factory :build do + factory :ci_build, class: Ci::Build do started_at 'Di 29. Okt 09:51:28 CET 2013' finished_at 'Di 29. Okt 09:53:28 CET 2013' commands 'ls -a' diff --git a/spec/ci/factories/commits.rb b/spec/factories/ci/commits.rb index 6fdd46fa74b..c1d42b607c3 100644 --- a/spec/ci/factories/commits.rb +++ b/spec/factories/ci/commits.rb @@ -17,7 +17,7 @@ # Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do - factory :commit do + factory :ci_commit, class: Ci::Commit do ref 'master' before_sha '76de212e80737a608d939f648d959671fb0a0142' sha '97de212e80737a608d939f648d959671fb0a0142' @@ -51,21 +51,21 @@ FactoryGirl.define do } end - factory :commit_without_jobs do + factory :ci_commit_without_jobs do after(:create) do |commit, evaluator| commit.push_data[:ci_yaml_file] = YAML.dump({}) commit.save end end - factory :commit_with_one_job do + factory :ci_commit_with_one_job do after(:create) do |commit, evaluator| commit.push_data[:ci_yaml_file] = YAML.dump({rspec: { script: "ls" }}) commit.save end end - factory :commit_with_two_jobs do + factory :ci_commit_with_two_jobs do after(:create) do |commit, evaluator| commit.push_data[:ci_yaml_file] = YAML.dump({rspec: { script: "ls" }, spinach: { script: "ls" }}) commit.save diff --git a/spec/ci/factories/events.rb b/spec/factories/ci/events.rb index 1dfa52e3529..03450751596 100644 --- a/spec/ci/factories/events.rb +++ b/spec/factories/ci/events.rb @@ -12,7 +12,7 @@ # FactoryGirl.define do - factory :event, class: Event do + factory :ci_event, class: Ci::Event do sequence :description do |n| "updated project settings#{n}" end diff --git a/spec/ci/factories/projects.rb b/spec/factories/ci/projects.rb index fb5b563f2f2..e6be88fa585 100644 --- a/spec/ci/factories/projects.rb +++ b/spec/factories/ci/projects.rb @@ -28,7 +28,7 @@ # Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do - factory :project_without_token, class: Project do + factory :ci_project_without_token, class: Ci::Project do sequence :name do |n| "GitLab / gitlab-shell#{n}" end @@ -45,11 +45,11 @@ FactoryGirl.define do sequence :gitlab_id - factory :project do + factory :ci_project do token 'iPWx6WM4lhHNedGfBpPJNP' end - factory :public_project do + factory :ci_public_project do public true end end diff --git a/spec/ci/factories/runner_projects.rb b/spec/factories/ci/runner_projects.rb index b27632b3429..3aa14ca434d 100644 --- a/spec/ci/factories/runner_projects.rb +++ b/spec/factories/ci/runner_projects.rb @@ -12,7 +12,7 @@ # Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do - factory :runner_project do + factory :ci_runner_project, class: Ci::RunnerProject do runner_id 1 project_id 1 end diff --git a/spec/ci/factories/runners.rb b/spec/factories/ci/runners.rb index 20a80f03268..fec56b438fa 100644 --- a/spec/ci/factories/runners.rb +++ b/spec/factories/ci/runners.rb @@ -20,7 +20,7 @@ # Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do - factory :runner do + factory :ci_runner, class: Ci::Runner do sequence :description do |n| "My runner#{n}" end diff --git a/spec/ci/factories/trigger_requests.rb b/spec/factories/ci/trigger_requests.rb index c85d1027ce6..c85d1027ce6 100644 --- a/spec/ci/factories/trigger_requests.rb +++ b/spec/factories/ci/trigger_requests.rb diff --git a/spec/ci/factories/triggers.rb b/spec/factories/ci/triggers.rb index a5af47b7d7f..38cd3cbceb6 100644 --- a/spec/ci/factories/triggers.rb +++ b/spec/factories/ci/triggers.rb @@ -1,7 +1,7 @@ # Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do - factory :trigger_without_token, class: Trigger do + factory :ci_trigger_without_token, class: Ci::Trigger do factory :trigger do token 'token' end diff --git a/spec/ci/factories/web_hook.rb b/spec/factories/ci/web_hook.rb index 3c027fb4861..1fde5805c94 100644 --- a/spec/ci/factories/web_hook.rb +++ b/spec/factories/ci/web_hook.rb @@ -1,5 +1,5 @@ FactoryGirl.define do - factory :web_hook do + factory :ci_web_hook, class: Ci::WebHook do sequence(:url) { Faker::Internet.uri('http') } project end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d0f1873ee2d..8442d3f4445 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -29,6 +29,9 @@ RSpec.configure do |config| config.include LoginHelpers, type: :request config.include StubConfiguration config.include TestEnv + config.include StubGitlabCalls + config.include StubGitlabData + config.infer_spec_type_from_file_location! config.raise_errors_for_deprecations! diff --git a/spec/ci/support/gitlab_stubs/gitlab_ci.yml b/spec/support/gitlab_stubs/gitlab_ci.yml index 3482145404e..3482145404e 100644 --- a/spec/ci/support/gitlab_stubs/gitlab_ci.yml +++ b/spec/support/gitlab_stubs/gitlab_ci.yml diff --git a/spec/ci/support/gitlab_stubs/project_8.json b/spec/support/gitlab_stubs/project_8.json index f0a9fce859c..f0a9fce859c 100644 --- a/spec/ci/support/gitlab_stubs/project_8.json +++ b/spec/support/gitlab_stubs/project_8.json diff --git a/spec/ci/support/gitlab_stubs/project_8_hooks.json b/spec/support/gitlab_stubs/project_8_hooks.json index 93d51406d63..93d51406d63 100644 --- a/spec/ci/support/gitlab_stubs/project_8_hooks.json +++ b/spec/support/gitlab_stubs/project_8_hooks.json diff --git a/spec/ci/support/gitlab_stubs/projects.json b/spec/support/gitlab_stubs/projects.json index ca42c14c5d8..ca42c14c5d8 100644 --- a/spec/ci/support/gitlab_stubs/projects.json +++ b/spec/support/gitlab_stubs/projects.json diff --git a/spec/ci/support/gitlab_stubs/raw_project.yml b/spec/support/gitlab_stubs/raw_project.yml index df2ce223d1f..df2ce223d1f 100644 --- a/spec/ci/support/gitlab_stubs/raw_project.yml +++ b/spec/support/gitlab_stubs/raw_project.yml diff --git a/spec/ci/support/gitlab_stubs/session.json b/spec/support/gitlab_stubs/session.json index ce8dfe5ae75..ce8dfe5ae75 100644 --- a/spec/ci/support/gitlab_stubs/session.json +++ b/spec/support/gitlab_stubs/session.json diff --git a/spec/ci/support/gitlab_stubs/user.json b/spec/support/gitlab_stubs/user.json index ce8dfe5ae75..ce8dfe5ae75 100644 --- a/spec/ci/support/gitlab_stubs/user.json +++ b/spec/support/gitlab_stubs/user.json diff --git a/spec/ci/support/setup_builds_storage.rb b/spec/support/setup_builds_storage.rb index cafc8dee918..cafc8dee918 100644 --- a/spec/ci/support/setup_builds_storage.rb +++ b/spec/support/setup_builds_storage.rb diff --git a/spec/ci/support/stub_gitlab_calls.rb b/spec/support/stub_gitlab_calls.rb index 931ef963c0f..931ef963c0f 100644 --- a/spec/ci/support/stub_gitlab_calls.rb +++ b/spec/support/stub_gitlab_calls.rb diff --git a/spec/ci/support/stub_gitlab_data.rb b/spec/support/stub_gitlab_data.rb index fa402f35b95..fa402f35b95 100644 --- a/spec/ci/support/stub_gitlab_data.rb +++ b/spec/support/stub_gitlab_data.rb |