diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-04-10 17:23:57 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-04-10 17:23:57 +0300 |
commit | 93c05484c971ccaa382c47bf7b162708af0d91e0 (patch) | |
tree | 8d02083646274d5f137cdd925812985ad8131fef | |
parent | e202718ac70f5bd35fdc40b426cb6174eebdd1e0 (diff) | |
download | gitlab-ci-93c05484c971ccaa382c47bf7b162708af0d91e0.tar.gz |
specs: move describe block out
-rw-r--r-- | spec/controllers/projects_controller_spec.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb index 9a788dc..88aeb7a 100644 --- a/spec/controllers/projects_controller_spec.rb +++ b/spec/controllers/projects_controller_spec.rb @@ -40,30 +40,30 @@ describe ProjectsController do expect(response).not_to be_success expect(response.code).to eq('403') end + end - describe "POST /:projects" do - let(:project_dump) { File.read(Rails.root.join('spec/support/gitlab_stubs/raw_project.yml')) } - let(:gitlab_url) { GitlabCi.config.gitlab_server.url } + describe "POST /:projects" do + let(:project_dump) { File.read(Rails.root.join('spec/support/gitlab_stubs/raw_project.yml')) } + let(:gitlab_url) { GitlabCi.config.gitlab_server.url } - let (:user_data) do - data = JSON.parse File.read(Rails.root.join('spec/support/gitlab_stubs/user.json')) - data.merge("url" => gitlab_url) - end + let (:user_data) do + data = JSON.parse File.read(Rails.root.join('spec/support/gitlab_stubs/user.json')) + data.merge("url" => gitlab_url) + end - let(:user) do - User.new(user_data) - end + let(:user) do + User.new(user_data) + end - it "creates project" do - allow(controller).to receive(:reset_cache) { true } - allow(controller).to receive(:current_user) { user } - Network.any_instance.stub(:enable_ci).and_return(true) + it "creates project" do + allow(controller).to receive(:reset_cache) { true } + allow(controller).to receive(:current_user) { user } + Network.any_instance.stub(:enable_ci).and_return(true) - post :create, { project: project_dump }.with_indifferent_access + post :create, { project: project_dump }.with_indifferent_access - Project.exists?(gitlab_id: 189).should be_true - expect(response.code).to eq('302') - end + Project.exists?(gitlab_id: 189).should be_true + expect(response.code).to eq('302') end end end |