summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/branches_controller_spec.rb4
-rw-r--r--spec/controllers/import/bitbucket_controller_spec.rb23
-rw-r--r--spec/controllers/import/github_controller_spec.rb16
-rw-r--r--spec/controllers/import/gitlab_controller_spec.rb14
4 files changed, 23 insertions, 34 deletions
diff --git a/spec/controllers/branches_controller_spec.rb b/spec/controllers/branches_controller_spec.rb
index 51397382cfb..db3b64babcd 100644
--- a/spec/controllers/branches_controller_spec.rb
+++ b/spec/controllers/branches_controller_spec.rb
@@ -17,13 +17,13 @@ describe Projects::BranchesController do
describe "POST create" do
render_views
- before {
+ before do
post :create,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
branch_name: branch,
ref: ref
- }
+ end
context "valid branch name, valid source" do
let(:branch) { "merge_branch" }
diff --git a/spec/controllers/import/bitbucket_controller_spec.rb b/spec/controllers/import/bitbucket_controller_spec.rb
index c31563e6d77..ddeeaf74fcb 100644
--- a/spec/controllers/import/bitbucket_controller_spec.rb
+++ b/spec/controllers/import/bitbucket_controller_spec.rb
@@ -12,7 +12,7 @@ describe Import::BitbucketController do
before do
session[:oauth_request_token] = {}
end
-
+
it "updates access token" do
token = "asdasd12345"
secret = "sekrettt"
@@ -57,20 +57,13 @@ describe Import::BitbucketController do
describe "POST create" do
let(:bitbucket_username) { user.username }
- let(:bitbucket_user) {
- {
- user: {
- username: bitbucket_username
- }
- }.with_indifferent_access
- }
-
- let(:bitbucket_repo) {
- {
- slug: "vim",
- owner: bitbucket_username
- }.with_indifferent_access
- }
+ let(:bitbucket_user) do
+ { user: { username: bitbucket_username } }.with_indifferent_access
+ end
+
+ let(:bitbucket_repo) do
+ { slug: "vim", owner: bitbucket_username }.with_indifferent_access
+ end
before do
allow(Gitlab::BitbucketImport::KeyAdder).
diff --git a/spec/controllers/import/github_controller_spec.rb b/spec/controllers/import/github_controller_spec.rb
index 3d3846b2e3a..5f2a09280b2 100644
--- a/spec/controllers/import/github_controller_spec.rb
+++ b/spec/controllers/import/github_controller_spec.rb
@@ -57,14 +57,14 @@ describe Import::GithubController do
describe "POST create" do
let(:github_username) { user.username }
-
- let(:github_user) {
- OpenStruct.new(login: github_username)
- }
-
- let(:github_repo) {
- OpenStruct.new(name: 'vim', full_name: "#{github_username}/vim", owner: OpenStruct.new(login: github_username))
- }
+ let(:github_user) { OpenStruct.new(login: github_username) }
+ let(:github_repo) do
+ OpenStruct.new(
+ name: 'vim',
+ full_name: "#{github_username}/vim",
+ owner: OpenStruct.new(login: github_username)
+ )
+ end
before do
controller.stub_chain(:client, :user).and_return(github_user)
diff --git a/spec/controllers/import/gitlab_controller_spec.rb b/spec/controllers/import/gitlab_controller_spec.rb
index 112e51d431e..a0c5ce1fe5b 100644
--- a/spec/controllers/import/gitlab_controller_spec.rb
+++ b/spec/controllers/import/gitlab_controller_spec.rb
@@ -49,21 +49,17 @@ describe Import::GitlabController do
describe "POST create" do
let(:gitlab_username) { user.username }
-
- let(:gitlab_user) {
- {
- username: gitlab_username
- }.with_indifferent_access
- }
-
- let(:gitlab_repo) {
+ let(:gitlab_user) do
+ { username: gitlab_username }.with_indifferent_access
+ end
+ let(:gitlab_repo) do
{
path: 'vim',
path_with_namespace: "#{gitlab_username}/vim",
owner: { name: gitlab_username },
namespace: { path: gitlab_username }
}.with_indifferent_access
- }
+ end
before do
controller.stub_chain(:client, :user).and_return(gitlab_user)