diff options
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/ci/builds.rb | 4 | ||||
-rw-r--r-- | spec/factories/ci/commits.rb | 2 | ||||
-rw-r--r-- | spec/factories/ci/events.rb | 24 | ||||
-rw-r--r-- | spec/factories/ci/projects.rb | 50 | ||||
-rw-r--r-- | spec/factories/ci/runner_projects.rb | 2 | ||||
-rw-r--r-- | spec/factories/ci/web_hook.rb | 6 |
6 files changed, 6 insertions, 82 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index 2fcd70182b9..f76e826f138 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -42,6 +42,10 @@ FactoryGirl.define do commit factory: :ci_commit + after(:build) do |build, evaluator| + build.project = build.commit.project + end + factory :ci_not_started_build do started_at nil finished_at nil diff --git a/spec/factories/ci/commits.rb b/spec/factories/ci/commits.rb index 70e3fa319c6..b42cafa518a 100644 --- a/spec/factories/ci/commits.rb +++ b/spec/factories/ci/commits.rb @@ -21,7 +21,7 @@ FactoryGirl.define do factory :ci_empty_commit, class: Ci::Commit do sha '97de212e80737a608d939f648d959671fb0a0142' - gl_project factory: :empty_project + project factory: :empty_project factory :ci_commit_without_jobs do after(:build) do |commit| diff --git a/spec/factories/ci/events.rb b/spec/factories/ci/events.rb deleted file mode 100644 index 9638618a400..00000000000 --- a/spec/factories/ci/events.rb +++ /dev/null @@ -1,24 +0,0 @@ -# == Schema Information -# -# Table name: events -# -# id :integer not null, primary key -# project_id :integer -# user_id :integer -# is_admin :integer -# description :text -# created_at :datetime -# updated_at :datetime -# - -FactoryGirl.define do - factory :ci_event, class: Ci::Event do - sequence :description do |n| - "updated project settings#{n}" - end - - factory :ci_admin_event do - is_admin true - end - end -end diff --git a/spec/factories/ci/projects.rb b/spec/factories/ci/projects.rb deleted file mode 100644 index 11cb8c9eeaa..00000000000 --- a/spec/factories/ci/projects.rb +++ /dev/null @@ -1,50 +0,0 @@ -# == Schema Information -# -# Table name: projects -# -# id :integer not null, primary key -# name :string(255) not null -# timeout :integer default(3600), not null -# created_at :datetime -# updated_at :datetime -# token :string(255) -# default_ref :string(255) -# path :string(255) -# always_build :boolean default(FALSE), not null -# polling_interval :integer -# public :boolean default(FALSE), not null -# ssh_url_to_repo :string(255) -# gitlab_id :integer -# allow_git_fetch :boolean default(TRUE), not null -# email_recipients :string(255) default(""), not null -# email_add_pusher :boolean default(TRUE), not null -# email_only_broken_builds :boolean default(TRUE), not null -# skip_refs :string(255) -# coverage_regex :string(255) -# shared_runners_enabled :boolean default(FALSE) -# generated_yaml_config :text -# - -# Read about factories at https://github.com/thoughtbot/factory_girl - -FactoryGirl.define do - factory :ci_project_without_token, class: Ci::Project do - default_ref 'master' - - shared_runners_enabled false - - factory :ci_project do - token 'iPWx6WM4lhHNedGfBpPJNP' - end - - initialize_with do - # TODO: - # this is required, because builds_enabled is initialized when Project is created - # and this create gitlab_ci_project if builds is set to true - # here we take created gitlab_ci_project and update it's attributes - ci_project = create(:empty_project).ensure_gitlab_ci_project - ci_project.update_attributes(attributes) - ci_project - end - end -end diff --git a/spec/factories/ci/runner_projects.rb b/spec/factories/ci/runner_projects.rb index 3aa14ca434d..008d1c5d961 100644 --- a/spec/factories/ci/runner_projects.rb +++ b/spec/factories/ci/runner_projects.rb @@ -14,6 +14,6 @@ FactoryGirl.define do factory :ci_runner_project, class: Ci::RunnerProject do runner_id 1 - project_id 1 + gl_project_id 1 end end diff --git a/spec/factories/ci/web_hook.rb b/spec/factories/ci/web_hook.rb deleted file mode 100644 index 40d878ecb3c..00000000000 --- a/spec/factories/ci/web_hook.rb +++ /dev/null @@ -1,6 +0,0 @@ -FactoryGirl.define do - factory :ci_web_hook, class: Ci::WebHook do - sequence(:url) { FFaker::Internet.uri('http') } - project factory: :ci_project - end -end |