summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/pipeline_schedules_controller_spec.rb
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-07-04 01:51:21 +0900
committerShinya Maeda <shinya@gitlab.com>2017-07-05 18:38:35 +0900
commit2f70f3fa35f4bce54350e87d75add4823d4b3ebe (patch)
treeebcd99ef5296a03d1b950f1378f92a72d80b5b07 /spec/controllers/projects/pipeline_schedules_controller_spec.rb
parent3acc91866bec2004f4dae542dae0d66a2921b4da (diff)
downloadgitlab-ce-2f70f3fa35f4bce54350e87d75add4823d4b3ebe.tar.gz
Improve spec
Diffstat (limited to 'spec/controllers/projects/pipeline_schedules_controller_spec.rb')
-rw-r--r--spec/controllers/projects/pipeline_schedules_controller_spec.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/spec/controllers/projects/pipeline_schedules_controller_spec.rb b/spec/controllers/projects/pipeline_schedules_controller_spec.rb
index 12eeca5408b..be6a758bb4d 100644
--- a/spec/controllers/projects/pipeline_schedules_controller_spec.rb
+++ b/spec/controllers/projects/pipeline_schedules_controller_spec.rb
@@ -47,11 +47,11 @@ describe Projects::PipelineSchedulesController do
end
describe 'GET #new' do
+ set(:user) { create(:user) }
+
before do
- create(:user).tap do |user|
- project.add_developer(user)
- sign_in(user)
- end
+ project.add_developer(user)
+ sign_in(user)
end
it 'initializes a pipeline schedule model' do
@@ -64,11 +64,11 @@ describe Projects::PipelineSchedulesController do
describe 'POST #create' do
describe 'functionality' do
+ set(:user) { create(:user) }
+
before do
- create(:user).tap do |user|
- project.add_developer(user)
- sign_in(user)
- end
+ project.add_developer(user)
+ sign_in(user)
end
let(:basic_param) do
@@ -188,7 +188,7 @@ describe Projects::PipelineSchedulesController do
describe 'PUT #update' do
describe 'functionality' do
- let(:user) { create(:user) }
+ set(:user) { create(:user) }
let!(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project, owner: user) }
before do
@@ -397,7 +397,6 @@ describe Projects::PipelineSchedulesController do
before do
project.add_master(user)
-
sign_in(user)
end