Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAndrey Kumanyaev <me@zzet.org>2013-05-05 18:01:10 +0400
committerAndrey Kumanyaev <me@zzet.org>2013-05-05 18:01:10 +0400
commit67ccc8b52aceebea9c0cb22b3277daf0b467c78e (patch)
tree6139a7674fe0f9d70a0af51c383fd72aa91cc54c /spec
parent493b5ff011d5788f669adabf978a40b49b8cf6a3 (diff)
Replace old hashes with new 1.9 ruby hashes (rebase)
Diffstat (limited to 'spec')
-rw-r--r--spec/observers/users_project_observer_spec.rb2
-rw-r--r--spec/requests/api/groups_spec.rb6
-rw-r--r--spec/routing/admin_routing_spec.rb24
-rw-r--r--spec/routing/project_routing_spec.rb14
-rw-r--r--spec/support/valid_commit.rb2
-rw-r--r--spec/tasks/gitlab/backup_rake_spec.rb10
6 files changed, 29 insertions, 29 deletions
diff --git a/spec/observers/users_project_observer_spec.rb b/spec/observers/users_project_observer_spec.rb
index 66d5c7d91af..b5f72946492 100644
--- a/spec/observers/users_project_observer_spec.rb
+++ b/spec/observers/users_project_observer_spec.rb
@@ -16,7 +16,7 @@ describe UsersProjectObserver do
it "should send email to user" do
subject.should_receive(:notification)
- Event.stub(:create => true)
+ Event.stub(create: true)
create(:users_project)
end
diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb
index e97ceb2c991..37199835d53 100644
--- a/spec/requests/api/groups_spec.rb
+++ b/spec/requests/api/groups_spec.rb
@@ -85,17 +85,17 @@ describe Gitlab::API do
end
it "should not create group, duplicate" do
- post api("/groups", admin), {:name => "Duplicate Test", :path => group2.path}
+ post api("/groups", admin), {name: "Duplicate Test", path: group2.path}
response.status.should == 404
end
it "should return 400 bad request error if name not given" do
- post api("/groups", admin), { :path => group2.path }
+ post api("/groups", admin), { path: group2.path }
response.status.should == 400
end
it "should return 400 bad request error if path not given" do
- post api("/groups", admin), { :name => 'test' }
+ post api("/groups", admin), { name: 'test' }
response.status.should == 400
end
end
diff --git a/spec/routing/admin_routing_spec.rb b/spec/routing/admin_routing_spec.rb
index b6509fcb8b2..c14fff5109b 100644
--- a/spec/routing/admin_routing_spec.rb
+++ b/spec/routing/admin_routing_spec.rb
@@ -56,15 +56,15 @@ describe Admin::UsersController, "routing" do
end
end
-# team_admin_project GET /admin/projects/:id/team(.:format) admin/projects#team {:id=>/[^\/]+/}
-# team_update_admin_project PUT /admin/projects/:id/team_update(.:format) admin/projects#team_update {:id=>/[^\/]+/}
-# admin_projects GET /admin/projects(.:format) admin/projects#index {:id=>/[^\/]+/}
-# POST /admin/projects(.:format) admin/projects#create {:id=>/[^\/]+/}
-# new_admin_project GET /admin/projects/new(.:format) admin/projects#new {:id=>/[^\/]+/}
-# edit_admin_project GET /admin/projects/:id/edit(.:format) admin/projects#edit {:id=>/[^\/]+/}
-# admin_project GET /admin/projects/:id(.:format) admin/projects#show {:id=>/[^\/]+/}
-# PUT /admin/projects/:id(.:format) admin/projects#update {:id=>/[^\/]+/}
-# DELETE /admin/projects/:id(.:format) admin/projects#destroy {:id=>/[^\/]+/}
+# team_admin_project GET /admin/projects/:id/team(.:format) admin/projects#team {id: /[^\/]+/}
+# team_update_admin_project PUT /admin/projects/:id/team_update(.:format) admin/projects#team_update {id: /[^\/]+/}
+# admin_projects GET /admin/projects(.:format) admin/projects#index {id: /[^\/]+/}
+# POST /admin/projects(.:format) admin/projects#create {id: /[^\/]+/}
+# new_admin_project GET /admin/projects/new(.:format) admin/projects#new {id: /[^\/]+/}
+# edit_admin_project GET /admin/projects/:id/edit(.:format) admin/projects#edit {id: /[^\/]+/}
+# admin_project GET /admin/projects/:id(.:format) admin/projects#show {id: /[^\/]+/}
+# PUT /admin/projects/:id(.:format) admin/projects#update {id: /[^\/]+/}
+# DELETE /admin/projects/:id(.:format) admin/projects#destroy {id: /[^\/]+/}
describe Admin::ProjectsController, "routing" do
it "to #index" do
get("/admin/projects").should route_to('admin/projects#index')
@@ -75,9 +75,9 @@ describe Admin::ProjectsController, "routing" do
end
end
-# edit_admin_project_member GET /admin/projects/:project_id/members/:id/edit(.:format) admin/projects/members#edit {:id=>/[^\/]+/, :project_id=>/[^\/]+/}
-# admin_project_member PUT /admin/projects/:project_id/members/:id(.:format) admin/projects/members#update {:id=>/[^\/]+/, :project_id=>/[^\/]+/}
-# DELETE /admin/projects/:project_id/members/:id(.:format) admin/projects/members#destroy {:id=>/[^\/]+/, :project_id=>/[^\/]+/}
+# edit_admin_project_member GET /admin/projects/:project_id/members/:id/edit(.:format) admin/projects/members#edit {id: /[^\/]+/, project_id: /[^\/]+/}
+# admin_project_member PUT /admin/projects/:project_id/members/:id(.:format) admin/projects/members#update {id: /[^\/]+/, project_id: /[^\/]+/}
+# DELETE /admin/projects/:project_id/members/:id(.:format) admin/projects/members#destroy {id: /[^\/]+/, project_id: /[^\/]+/}
describe Admin::Projects::MembersController, "routing" do
it "to #edit" do
get("/admin/projects/test/members/1/edit").should route_to('admin/projects/members#edit', project_id: 'test', id: '1')
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb
index dd4fb54af69..613c4565755 100644
--- a/spec/routing/project_routing_spec.rb
+++ b/spec/routing/project_routing_spec.rb
@@ -279,7 +279,7 @@ describe HooksController, "routing" do
end
end
-# project_commit GET /:project_id/commit/:id(.:format) commit#show {:id=>/[[:alnum:]]{6,40}/, :project_id=>/[^\/]+/}
+# project_commit GET /:project_id/commit/:id(.:format) commit#show {id: /[[:alnum:]]{6,40}/, project_id: /[^\/]+/}
describe CommitController, "routing" do
it "to #show" do
get("/gitlabhq/commit/4246fb").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb')
@@ -375,7 +375,7 @@ describe NotesController, "routing" do
end
end
-# project_blame GET /:project_id/blame/:id(.:format) blame#show {:id=>/.+/, :project_id=>/[^\/]+/}
+# project_blame GET /:project_id/blame/:id(.:format) blame#show {id: /.+/, project_id: /[^\/]+/}
describe BlameController, "routing" do
it "to #show" do
get("/gitlabhq/blame/master/app/models/project.rb").should route_to('blame#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
@@ -383,7 +383,7 @@ describe BlameController, "routing" do
end
end
-# project_blob GET /:project_id/blob/:id(.:format) blob#show {:id=>/.+/, :project_id=>/[^\/]+/}
+# project_blob GET /:project_id/blob/:id(.:format) blob#show {id: /.+/, project_id: /[^\/]+/}
describe BlobController, "routing" do
it "to #show" do
get("/gitlabhq/blob/master/app/models/project.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
@@ -392,7 +392,7 @@ describe BlobController, "routing" do
end
end
-# project_tree GET /:project_id/tree/:id(.:format) tree#show {:id=>/.+/, :project_id=>/[^\/]+/}
+# project_tree GET /:project_id/tree/:id(.:format) tree#show {id: /.+/, project_id: /[^\/]+/}
describe TreeController, "routing" do
it "to #show" do
get("/gitlabhq/tree/master/app/models/project.rb").should route_to('tree#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
@@ -400,9 +400,9 @@ describe TreeController, "routing" do
end
end
-# project_compare_index GET /:project_id/compare(.:format) compare#index {:id=>/[^\/]+/, :project_id=>/[^\/]+/}
-# POST /:project_id/compare(.:format) compare#create {:id=>/[^\/]+/, :project_id=>/[^\/]+/}
-# project_compare /:project_id/compare/:from...:to(.:format) compare#show {:from=>/.+/, :to=>/.+/, :id=>/[^\/]+/, :project_id=>/[^\/]+/}
+# project_compare_index GET /:project_id/compare(.:format) compare#index {id: /[^\/]+/, project_id: /[^\/]+/}
+# POST /:project_id/compare(.:format) compare#create {id: /[^\/]+/, project_id: /[^\/]+/}
+# project_compare /:project_id/compare/:from...:to(.:format) compare#show {from: /.+/, to: /.+/, id: /[^\/]+/, project_id: /[^\/]+/}
describe CompareController, "routing" do
it "to #index" do
get("/gitlabhq/compare").should route_to('compare#index', project_id: 'gitlabhq')
diff --git a/spec/support/valid_commit.rb b/spec/support/valid_commit.rb
index 8094b679e99..0af36e34293 100644
--- a/spec/support/valid_commit.rb
+++ b/spec/support/valid_commit.rb
@@ -9,7 +9,7 @@ module ValidCommit
C_FILE_PATH = "app/models"
C_FILES = [".gitkeep", "ability.rb", "commit.rb", "issue.rb", "key.rb", "mailer_observer.rb", "merge_request.rb", "note.rb", "project.rb", "protected_branch.rb", "repository.rb", "snippet.rb", "tree.rb", "user.rb", "users_project.rb", "web_hook.rb", "wiki.rb"]
- BLOB_FILE = %{%h3= @key.title\n%hr\n%pre= @key.key\n.actions\n = link_to 'Remove', @key, :confirm => 'Are you sure?', :method => :delete, :class => \"btn danger delete-key\"\n\n\n}
+ BLOB_FILE = %{%h3= @key.title\n%hr\n%pre= @key.key\n.actions\n = link_to 'Remove', @key, confirm: 'Are you sure?', method: :delete, class: \"btn danger delete-key\"\n\n\n}
BLOB_FILE_PATH = "app/views/keys/show.html.haml"
end
diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb
index babbf2916f8..4ad63114cb4 100644
--- a/spec/tasks/gitlab/backup_rake_spec.rb
+++ b/spec/tasks/gitlab/backup_rake_spec.rb
@@ -22,21 +22,21 @@ describe 'gitlab:app namespace rake task' do
context 'gitlab version' do
before do
- Dir.stub :glob => []
+ Dir.stub glob: []
Dir.stub :chdir
- File.stub :exists? => true
- Kernel.stub :system => true
+ File.stub exists?: true
+ Kernel.stub system: true
end
let(:gitlab_version) { %x{git rev-parse HEAD}.gsub(/\n/,"") }
it 'should fail on mismach' do
- YAML.stub :load_file => {:gitlab_version => gitlab_version.reverse}
+ YAML.stub load_file: {gitlab_version: gitlab_version.reverse}
expect { run_rake_task }.to raise_error SystemExit
end
it 'should invoke restoration on mach' do
- YAML.stub :load_file => {:gitlab_version => gitlab_version}
+ YAML.stub load_file: {gitlab_version: gitlab_version}
Rake::Task["gitlab:backup:db:restore"].should_receive :invoke
Rake::Task["gitlab:backup:repo:restore"].should_receive :invoke
expect { run_rake_task }.to_not raise_error SystemExit