Commit af5d0e9e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #3275 from Undev/feature/code_cleanup_remove_old_hashes

Code cleanup: Replace old hashes and remove trailing spaces
parents dc41ffa3 a50d96a8
<h2>Resend confirmation instructions</h2> <h2>Resend confirmation instructions</h2>
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %> <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %> <%= devise_error_messages! %>
<div><%= f.label :email %><br /> <div><%= f.label :email %><br />
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
<div><%= f.submit "Resend confirmation instructions" %></div> <div><%= f.submit "Resend confirmation instructions" %></div>
<% end %> <% end %>
<%= render :partial => "devise/shared/links" %> <%= render partial: "devise/shared/links" %>
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
<p>You can confirm your account through the link below:</p> <p>You can confirm your account through the link below:</p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p> <p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @resource.confirmation_token) %></p>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<p>Someone has requested a link to change your password, and you can do this through the link below.</p> <p>Someone has requested a link to change your password, and you can do this through the link below.</p>
<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p> <p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @resource.reset_password_token) %></p>
<p>If you didn't request this, please ignore this email.</p> <p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p> <p>Your password won't change until you access the link above and create a new one.</p>
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
<p>Click the link below to unlock your account:</p> <p>Click the link below to unlock your account:</p>
<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p> <p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @resource.unlock_token) %></p>
<h2>Edit <%= resource_name.to_s.humanize %></h2> <h2>Edit <%= resource_name.to_s.humanize %></h2>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %> <%= devise_error_messages! %>
<div><%= f.label :email %><br /> <div><%= f.label :email %><br />
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br /> <div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password %></div> <%= f.password_field :current_password %></div>
<div><%= f.submit "Update", :class => "input_button" %></div> <div><%= f.submit "Update", class: "input_button" %></div>
<% end %> <% end %>
<h3>Cancel my account</h3> <h3>Cancel my account</h3>
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p> <p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), confirm: "Are you sure?", method: :delete %>.</p>
<%= link_to "Back", :back %> <%= link_to "Back", :back %>
<%- if controller_name != 'sessions' %> <%- if controller_name != 'sessions' %>
<%= link_to "Sign in", new_session_path(resource_name), :class => "btn" %><br /> <%= link_to "Sign in", new_session_path(resource_name), class: "btn" %><br />
<% end -%> <% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %> <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<% end -%> <% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %> <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<%= link_to "Forgot your password?", new_password_path(resource_name), :class => "btn" %><br /> <%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn" %><br />
<% end -%> <% end -%>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
......
<h2>Resend unlock instructions</h2> <h2>Resend unlock instructions</h2>
<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %> <%= devise_error_messages! %>
<div><%= f.label :email %><br /> <div><%= f.label :email %><br />
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
<div><%= f.submit "Resend unlock instructions" %></div> <div><%= f.submit "Resend unlock instructions" %></div>
<% end %> <% end %>
<%= render :partial => "devise/shared/links" %> <%= render partial: "devise/shared/links" %>
...@@ -4,7 +4,7 @@ require 'rails/all' ...@@ -4,7 +4,7 @@ require 'rails/all'
if defined?(Bundler) if defined?(Bundler)
# If you precompile assets before deploying to production, use this line # If you precompile assets before deploying to production, use this line
# Bundler.require(*Rails.groups(:assets => %w(development test))) # Bundler.require(*Rails.groups(assets: %w(development test)))
# If you want your assets lazily compiled in production, use this line # If you want your assets lazily compiled in production, use this line
Bundler.require(:default, :assets, Rails.env) Bundler.require(:default, :assets, Rails.env)
end end
......
...@@ -68,8 +68,8 @@ Gitlab::Application.configure do ...@@ -68,8 +68,8 @@ Gitlab::Application.configure do
config.action_mailer.delivery_method = :sendmail config.action_mailer.delivery_method = :sendmail
# Defaults to: # Defaults to:
# # config.action_mailer.sendmail_settings = { # # config.action_mailer.sendmail_settings = {
# # :location => '/usr/sbin/sendmail', # # location: '/usr/sbin/sendmail',
# # :arguments => '-i -t' # # arguments: '-i -t'
# # } # # }
config.action_mailer.perform_deliveries = true config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true config.action_mailer.raise_delivery_errors = true
......
...@@ -94,7 +94,7 @@ Devise.setup do |config| ...@@ -94,7 +94,7 @@ Devise.setup do |config|
# config.extend_remember_period = false # config.extend_remember_period = false
# Options to be passed to the created cookie. For instance, you can set # Options to be passed to the created cookie. For instance, you can set
# :secure => true in order to force SSL only cookies. # secure: true in order to force SSL only cookies.
# config.cookie_options = {} # config.cookie_options = {}
# ==> Configuration for :validatable # ==> Configuration for :validatable
...@@ -202,18 +202,18 @@ Devise.setup do |config| ...@@ -202,18 +202,18 @@ Devise.setup do |config|
# config.warden do |manager| # config.warden do |manager|
# manager.failure_app = AnotherApp # manager.failure_app = AnotherApp
# manager.intercept_401 = false # manager.intercept_401 = false
# manager.default_strategies(:scope => :user).unshift :some_external_strategy # manager.default_strategies(scope: :user).unshift :some_external_strategy
# end # end
if Gitlab.config.ldap.enabled if Gitlab.config.ldap.enabled
config.omniauth :ldap, config.omniauth :ldap,
:host => Gitlab.config.ldap['host'], host: Gitlab.config.ldap['host'],
:base => Gitlab.config.ldap['base'], base: Gitlab.config.ldap['base'],
:uid => Gitlab.config.ldap['uid'], uid: Gitlab.config.ldap['uid'],
:port => Gitlab.config.ldap['port'], port: Gitlab.config.ldap['port'],
:method => Gitlab.config.ldap['method'], method: Gitlab.config.ldap['method'],
:bind_dn => Gitlab.config.ldap['bind_dn'], bind_dn: Gitlab.config.ldap['bind_dn'],
:password => Gitlab.config.ldap['password'] password: Gitlab.config.ldap['password']
end end
Gitlab.config.omniauth.providers.each do |provider| Gitlab.config.omniauth.providers.each do |provider|
......
...@@ -179,8 +179,7 @@ Gitlab::Application.routes.draw do ...@@ -179,8 +179,7 @@ Gitlab::Application.routes.draw do
resources :compare, only: [:index, :create] resources :compare, only: [:index, :create]
resources :blame, only: [:show], constraints: {id: /.+/} resources :blame, only: [:show], constraints: {id: /.+/}
resources :graph, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/} resources :graph, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
match "/compare/:from...:to" => "compare#show", as: "compare", match "/compare/:from...:to" => "compare#show", as: "compare", via: [:get, :post], constraints: {from: /.+/, to: /.+/}
:via => [:get, :post], constraints: {from: /.+/, to: /.+/}
resources :wikis, only: [:show, :edit, :destroy, :create] do resources :wikis, only: [:show, :edit, :destroy, :create] do
collection do collection do
......
Milestone.seed(:id, [ Milestone.seed(:id, [
{ :id => 1, :project_id => 1, :title => 'v' + Faker::Address.zip_code }, { id: 1, project_id: 1, title: 'v' + Faker::Address.zip_code },
{ :id => 2, :project_id => 1, :title => 'v' + Faker::Address.zip_code }, { id: 2, project_id: 1, title: 'v' + Faker::Address.zip_code },
{ :id => 3, :project_id => 1, :title => 'v' + Faker::Address.zip_code }, { id: 3, project_id: 1, title: 'v' + Faker::Address.zip_code },
{ :id => 4, :project_id => 2, :title => 'v' + Faker::Address.zip_code }, { id: 4, project_id: 2, title: 'v' + Faker::Address.zip_code },
{ :id => 5, :project_id => 2, :title => 'v' + Faker::Address.zip_code }, { id: 5, project_id: 2, title: 'v' + Faker::Address.zip_code },
{ :id => 6, :project_id => 2, :title => 'v' + Faker::Address.zip_code }, { id: 6, project_id: 2, title: 'v' + Faker::Address.zip_code },
{ :id => 7, :project_id => 2, :title => 'v' + Faker::Address.zip_code }, { id: 7, project_id: 2, title: 'v' + Faker::Address.zip_code },
{ :id => 8, :project_id => 3, :title => 'v' + Faker::Address.zip_code }, { id: 8, project_id: 3, title: 'v' + Faker::Address.zip_code },
{ :id => 9, :project_id => 3, :title => 'v' + Faker::Address.zip_code }, { id: 9, project_id: 3, title: 'v' + Faker::Address.zip_code },
{ :id => 11, :project_id => 3, :title => 'v' + Faker::Address.zip_code }, { id: 11, project_id: 3, title: 'v' + Faker::Address.zip_code },
]) ])
...@@ -20,12 +20,12 @@ class AdminGroups < Spinach::FeatureSteps ...@@ -20,12 +20,12 @@ class AdminGroups < Spinach::FeatureSteps
end end
And 'Create gitlab user "John"' do And 'Create gitlab user "John"' do
create(:user, :name => "John") create(:user, name: "John")
end end
And 'submit form with new group info' do And 'submit form with new group info' do
fill_in 'group_name', :with => 'gitlab' fill_in 'group_name', with: 'gitlab'
fill_in 'group_description', :with => 'Group description' fill_in 'group_description', with: 'Group description'
click_button "Create group" click_button "Create group"
end end
...@@ -41,8 +41,8 @@ class AdminGroups < Spinach::FeatureSteps ...@@ -41,8 +41,8 @@ class AdminGroups < Spinach::FeatureSteps
When 'I select user "John" from user list as "Reporter"' do When 'I select user "John" from user list as "Reporter"' do
user = User.find_by_name("John") user = User.find_by_name("John")
within "#new_team_member" do within "#new_team_member" do
select user.name, :from => "user_ids" select user.name, from: "user_ids"
select "Reporter", :from => "project_access" select "Reporter", from: "project_access"
end end
click_button "Add user to projects in group" click_button "Add user to projects in group"
end end
......
...@@ -39,8 +39,8 @@ class Groups < Spinach::FeatureSteps ...@@ -39,8 +39,8 @@ class Groups < Spinach::FeatureSteps
And 'I select user "John" from list with role "Reporter"' do And 'I select user "John" from list with role "Reporter"' do
user = User.find_by_name("John") user = User.find_by_name("John")
within "#new_team_member" do within "#new_team_member" do
select user.name, :from => "user_ids" select user.name, from: "user_ids"
select "Reporter", :from => "project_access" select "Reporter", from: "project_access"
end end
click_button "Add" click_button "Add"
end end
...@@ -85,7 +85,7 @@ class Groups < Spinach::FeatureSteps ...@@ -85,7 +85,7 @@ class Groups < Spinach::FeatureSteps
end end
And 'I change group name' do And 'I change group name' do
fill_in 'group_name', :with => 'new-name' fill_in 'group_name', with: 'new-name'
click_button "Save group" click_button "Save group"
end end
......
...@@ -9,9 +9,9 @@ class Profile < Spinach::FeatureSteps ...@@ -9,9 +9,9 @@ class Profile < Spinach::FeatureSteps
end end
Then 'I change my contact info' do Then 'I change my contact info' do
fill_in "user_skype", :with => "testskype" fill_in "user_skype", with: "testskype"
fill_in "user_linkedin", :with => "testlinkedin" fill_in "user_linkedin", with: "testlinkedin"
fill_in "user_twitter", :with => "testtwitter" fill_in "user_twitter", with: "testtwitter"
click_button "Save" click_button "Save"
@user.reload @user.reload
end end
...@@ -24,8 +24,8 @@ class Profile < Spinach::FeatureSteps ...@@ -24,8 +24,8 @@ class Profile < Spinach::FeatureSteps
Then 'I change my password' do Then 'I change my password' do
within '.update-password' do within '.update-password' do
fill_in "user_password", :with => "222333" fill_in "user_password", with: "222333"
fill_in "user_password_confirmation", :with => "222333" fill_in "user_password_confirmation", with: "222333"
click_button "Save" click_button "Save"
end end
end end
......
...@@ -12,8 +12,8 @@ class ProfileSshKeys < Spinach::FeatureSteps ...@@ -12,8 +12,8 @@ class ProfileSshKeys < Spinach::FeatureSteps
end end
And 'I submit new ssh key "Laptop"' do And 'I submit new ssh key "Laptop"' do
fill_in "key_title", :with => "Laptop" fill_in "key_title", with: "Laptop"
fill_in "key_key", :with => "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop" fill_in "key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop"
click_button "Save" click_button "Save"
end end
...@@ -43,6 +43,6 @@ class ProfileSshKeys < Spinach::FeatureSteps ...@@ -43,6 +43,6 @@ class ProfileSshKeys < Spinach::FeatureSteps
end end
And 'I have ssh key "ssh-rsa Work"' do And 'I have ssh key "ssh-rsa Work"' do
create(:key, :user => @user, :title => "ssh-rsa Work", :key => "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+L3TbFegm3k8QjejSwemk4HhlRh+DuN679Pc5ckqE/MPhVtE/+kZQDYCTB284GiT2aIoGzmZ8ee9TkaoejAsBwlA+Wz2Q3vhz65X6sMgalRwpdJx8kSEUYV8ZPV3MZvPo8KdNg993o4jL6G36GDW4BPIyO6FPZhfsawdf6liVD0Xo5kibIK7B9VoE178cdLQtLpS2YolRwf5yy6XR6hbbBGQR+6xrGOdP16eGZDb1CE2bMvvJijjloFqPscGktWOqW+nfh5txwFfBzlfARDTBsS8WZtg3Yoj1kn33kPsWRlgHfNutFRAIynDuDdQzQq8tTtVwm+Yi75RfcPHW8y3P Work") create(:key, user: @user, title: "ssh-rsa Work", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+L3TbFegm3k8QjejSwemk4HhlRh+DuN679Pc5ckqE/MPhVtE/+kZQDYCTB284GiT2aIoGzmZ8ee9TkaoejAsBwlA+Wz2Q3vhz65X6sMgalRwpdJx8kSEUYV8ZPV3MZvPo8KdNg993o4jL6G36GDW4BPIyO6FPZhfsawdf6liVD0Xo5kibIK7B9VoE178cdLQtLpS2YolRwf5yy6XR6hbbBGQR+6xrGOdP16eGZDb1CE2bMvvJijjloFqPscGktWOqW+nfh5txwFfBzlfARDTBsS8WZtg3Yoj1kn33kPsWRlgHfNutFRAIynDuDdQzQq8tTtVwm+Yi75RfcPHW8y3P Work")
end end
end end
...@@ -30,6 +30,6 @@ class ProjectBrowseBranches < Spinach::FeatureSteps ...@@ -30,6 +30,6 @@ class ProjectBrowseBranches < Spinach::FeatureSteps
And 'project "Shop" has protected branches' do And 'project "Shop" has protected branches' do
project = Project.find_by_name("Shop") project = Project.find_by_name("Shop")
project.protected_branches.create(:name => "stable") project.protected_branches.create(name: "stable")
end end
end end
...@@ -17,9 +17,9 @@ class ProjectBrowseCommits < Spinach::FeatureSteps ...@@ -17,9 +17,9 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
Then 'I see commits atom feed' do Then 'I see commits atom feed' do
commit = @project.repository.commit commit = @project.repository.commit
page.response_headers['Content-Type'].should have_content("application/atom+xml") page.response_headers['Content-Type'].should have_content("application/atom+xml")
page.body.should have_selector("title", :text => "Recent commits to #{@project.name}") page.body.should have_selector("title", text: "Recent commits to #{@project.name}")
page.body.should have_selector("author email", :text => commit.author_email) page.body.should have_selector("author email", text: commit.author_email)
page.body.should have_selector("entry summary", :text => commit.description) page.body.should have_selector("entry summary", text: commit.description)
end end
Given 'I click on commit link' do Given 'I click on commit link' do
......
...@@ -41,7 +41,7 @@ class ProjectIssues < Spinach::FeatureSteps ...@@ -41,7 +41,7 @@ class ProjectIssues < Spinach::FeatureSteps
end end
And 'I submit new issue "500 error on profile"' do And 'I submit new issue "500 error on profile"' do
fill_in "issue_title", :with => "500 error on profile" fill_in "issue_title", with: "500 error on profile"
click_button "Submit new issue" click_button "Submit new issue"
end end
...@@ -78,16 +78,16 @@ class ProjectIssues < Spinach::FeatureSteps ...@@ -78,16 +78,16 @@ class ProjectIssues < Spinach::FeatureSteps
Given 'project "Shop" has milestone "v2.2"' do Given 'project "Shop" has milestone "v2.2"' do
project = Project.find_by_name("Shop") project = Project.find_by_name("Shop")
milestone = create(:milestone, :title => "v2.2", :project => project) milestone = create(:milestone, title: "v2.2", project: project)
3.times { create(:issue, :project => project, :milestone => milestone) } 3.times { create(:issue, project: project, milestone: milestone) }
end end
And 'project "Shop" has milestone "v3.0"' do And 'project "Shop" has milestone "v3.0"' do
project = Project.find_by_name("Shop") project = Project.find_by_name("Shop")
milestone = create(:milestone, :title => "v3.0", :project => project) milestone = create(:milestone, title: "v3.0", project: project)
3.times { create(:issue, :project => project, :milestone => milestone) } 3.times { create(:issue, project: project, milestone: milestone) }
end end
When 'I select milestone "v3.0"' do When 'I select milestone "v3.0"' do
...@@ -115,16 +115,16 @@ class ProjectIssues < Spinach::FeatureSteps ...@@ -115,16 +115,16 @@ class ProjectIssues < Spinach::FeatureSteps
And 'project "Shop" have "Release 0.4" open issue' do And 'project "Shop" have "Release 0.4" open issue' do
project = Project.find_by_name("Shop") project = Project.find_by_name("Shop")
create(:issue, create(:issue,
:title => "Release 0.4", title: "Release 0.4",
:project => project, project: project,
:author => project.users.first) author: project.users.first)
end end
And 'project "Shop" have "Release 0.3" closed issue' do And 'project "Shop" have "Release 0.3" closed issue' do
project = Project.find_by_name("Shop") project = Project.find_by_name("Shop")
create(:closed_issue, create(:closed_issue,
:title => "Release 0.3", title: "Release 0.3",
:project => project, project: project,
:author => project.users.first) author: project.users.first)
end end
end end
...@@ -56,9 +56,9 @@ class ProjectMergeRequests < Spinach::FeatureSteps ...@@ -56,9 +56,9 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end end
And 'I submit new merge request "Wiki Feature"' do And 'I submit new merge request "Wiki Feature"' do
fill_in "merge_request_title", :with => "Wiki Feature" fill_in "merge_request_title", with: "Wiki Feature"
select "master", :from => "merge_request_source_branch" select "master", from: "merge_request_source_branch"
select "stable", :from => "merge_request_target_branch" select "stable", from: "merge_request_target_branch"
click_button "Submit merge request" click_button "Submit merge request"
end end
......
...@@ -19,7 +19,7 @@ class ProjectMilestones < Spinach::FeatureSteps ...@@ -19,7 +19,7 @@ class ProjectMilestones < Spinach::FeatureSteps
end end
And 'I submit new milestone "v2.3"' do And 'I submit new milestone "v2.3"' do
fill_in "milestone_title", :with => "v2.3" fill_in "milestone_title", with: "v2.3"
click_button "Create milestone" click_button "Create milestone"
end end
...@@ -32,9 +32,9 @@ class ProjectMilestones < Spinach::FeatureSteps ...@@ -32,9 +32,9 @@ class ProjectMilestones < Spinach::FeatureSteps
And 'project "Shop" has milestone "v2.2"' do And 'project "Shop" has milestone "v2.2"' do
project = Project.find_by_name("Shop") project = Project.find_by_name("Shop")
milestone = create(:milestone, :title => "v2.2", :project => project) milestone = create(:milestone, title: "v2.2", project: project)
3.times { create(:issue, :project => project, :milestone => milestone) } 3.times { create(:issue, project: project, milestone: milestone) }
end end
Given 'the milestone has open and closed issues' do Given 'the milestone has open and closed issues' do
......
...@@ -16,7 +16,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps ...@@ -16,7 +16,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
end end
And 'page should select "master" in select box' do And 'page should select "master" in select box' do
page.should have_selector '#ref_chzn span', :text => "master" page.should have_selector '#ref_chzn span', text: "master"
end end
And 'page should have "master" on graph' do And 'page should have "master" on graph' do
...@@ -26,21 +26,21 @@ class ProjectNetworkGraph < Spinach::FeatureSteps ...@@ -26,21 +26,21 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
end end
When 'I switch ref to "stable"' do When 'I switch ref to "stable"' do
page.select 'stable', :from => 'ref' page.select 'stable', from: 'ref'
sleep 2 sleep 2
end end
When 'I switch ref to "v2.1.0"' do When 'I switch ref to "v2.1.0"' do
page.select 'v2.1.0', :from => 'ref' page.select 'v2.1.0', from: 'ref'
sleep 2 sleep 2
end end
And 'page should select "stable" in select box' do And 'page should select "stable" in select box' do
page.should have_selector '#ref_chzn span', :text => "stable" page.should have_selector '#ref_chzn span', text: "stable"
end end
And 'page should select "v2.1.0" in select box' do And 'page should select "v2.1.0" in select box' do
page.should have_selector '#ref_chzn span', :text => "v2.1.0" page.should have_selector '#ref_chzn span', text: "v2.1.0"
end end
And 'page should have "stable" on graph' do And 'page should have "stable" on graph' do
...@@ -51,7 +51,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps ...@@ -51,7 +51,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
When 'I looking for a commit by SHA of "v2.1.0"' do When 'I looking for a commit by SHA of "v2.1.0"' do
within ".content .search" do within ".content .search" do
fill_in 'q', :with => '98d6492' fill_in 'q', with: '98d6492'
find('button').click find('button').click
end end
sleep 2 sleep 2
......
...@@ -16,7 +16,7 @@ class ProjectWiki < Spinach::FeatureSteps ...@@ -16,7 +16,7 @@ class ProjectWiki < Spinach::FeatureSteps
end end
Given 'I create the Wiki Home page' do Given 'I create the Wiki Home page' do
fill_in "Content", :with => '[link test](test)' fill_in "Content", with: '[link test](test)'
click_on "Save" click_on "Save"
end end
...@@ -42,7 +42,7 @@ class ProjectWiki < Spinach::FeatureSteps ...@@ -42,7 +42,7 @@ class ProjectWiki < Spinach::FeatureSteps
end end
And 'I change the content' do And 'I change the content' do
fill_in "Content", :with => 'Updated Wiki Content' fill_in "Content", with: 'Updated Wiki Content'
click_on "Save" click_on "Save"
end end
......
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
@user @user
elsif @user = User.find_by_email(email) elsif @user = User.find_by_email(email)
log.info "Updating legacy LDAP user #{email} with extern_uid => #{uid}" log.info "Updating legacy LDAP user #{email} with extern_uid => #{uid}"
@user.update_attributes(:extern_uid => uid, :provider => provider) @user.update_attributes(extern_uid: uid, provider: provider)
@user @user
else else
create_from_omniauth(auth, true) create_from_omniauth(auth, true)
...@@ -57,7 +57,7 @@ module Gitlab ...@@ -57,7 +57,7 @@ module Gitlab
if @user = User.find_by_provider_and_extern_uid(provider, uid) if @user = User.find_by_provider_and_extern_uid(provider, uid)
@user @user
elsif @user = User.find_by_email(email) elsif @user = User.find_by_email(email)
@user.update_attributes(:extern_uid => uid, :provider => provider) @user.update_attributes(extern_uid: uid, provider: provider)
@user @user
else else
if Gitlab.config.omniauth['allow_single_sign_on'] if Gitlab.config.omniauth['allow_single_sign_on']
......
...@@ -2,7 +2,7 @@ module Gitlab ...@@ -2,7 +2,7 @@ module Gitlab
module Popen module Popen
def popen(cmd, path) def popen(cmd, path)
vars = { "PWD" => path } vars = { "PWD" => path }
options = { :chdir => path } options = { chdir: path }
@cmd_output = "" @cmd_output = ""
@cmd_status = 0 @cmd_status = 0
......
...@@ -4,7 +4,7 @@ namespace :gitlab do ...@@ -4,7 +4,7 @@ namespace :gitlab do
namespace :backup do namespace :backup do
# Create backup of GitLab system # Create backup of GitLab system
desc "GITLAB | Create a backup of the GitLab system" desc "GITLAB | Create a backup of the GitLab system"
task :create => :environment do task create: :environment do
warn_user_is_not_gitlab warn_user_is_not_gitlab
Rake::Task["gitlab:backup:db:create"].invoke Rake::Task["gitlab:backup:db:create"].invoke
...@@ -57,7 +57,7 @@ namespace :gitlab do ...@@ -57,7 +57,7 @@ namespace :gitlab do
# Restore backup of GitLab system # Restore backup of GitLab system
desc "GITLAB | Restore a previously created backup" desc "GITLAB | Restore a previously created backup"
task :restore => :environment do task restore: :environment do
warn_user_is_not_gitlab warn_user_is_not_gitlab
Dir.chdir(Gitlab.config.backup.path) Dir.chdir(Gitlab.config.backup.path)
...@@ -113,13 +113,13 @@ namespace :gitlab do ...@@ -113,13 +113,13 @@ namespace :gitlab do
end end
namespace :repo do namespace :repo do
task :create => :environment do task create: :environment do
puts "Dumping repositories ...".blue puts "Dumping repositories ...".blue
Backup::Repository.new.dump Backup::Repository.new.dump
puts "done".green puts "done".green
end end
task :restore => :environment do task restore: :environment do
puts "Restoring repositories ...".blue puts "Restoring repositories ...".blue
Backup::Repository.new.restore Backup::Repository.new.restore
puts "done".green puts "done".green
...@@ -127,13 +127,13 @@ namespace :gitlab do ...@@ -127,13 +127,13 @@ namespace :gitlab do
end end
namespace :db do namespace :db do
task :create => :environment do task create: :environment do
puts "Dumping database ... ".blue puts "Dumping database ... ".blue
Backup::Database.new.dump Backup::Database.new.dump
puts "done".green puts "done".green
end end
task :restore => :environment do task restore: :environment do
puts "Restoring database ... ".blue puts "Restoring database ... ".blue
Backup::Database.new.restore Backup::Database.new.restore
puts "done".green puts "done".green
...@@ -141,13 +141,13 @@ namespace :gitlab do ...@@ -141,13 +141,13 @@ namespace :gitlab do
end end
namespace :uploads do namespace :uploads do
task :create => :environment do task create: :environment do
puts "Dumping uploads ... ".blue puts "Dumping uploads ... ".blue
Backup::Uploads.new.dump Backup::Uploads.new.dump
puts "done".green puts "done".green
end end
task :restore => :environment do task restore: :environment do
puts "Restoring uploads ... ".blue puts "Restoring uploads ... ".blue
Backup::Uploads.new.restore Backup::Uploads.new.restore
puts "done".green puts "done".green
......
namespace :gitlab do namespace :gitlab do
namespace :import do namespace :import do
desc "GITLAB | Add all users to all projects (admin users are added as masters)" desc "GITLAB | Add all users to all projects (admin users are added as masters)"
task :all_users_to_all_projects => :environment do |t, args| task all_users_to_all_projects: :environment do |t, args|
user_ids = User.where(:admin => false).pluck(:id) user_ids = User.where(admin: false).pluck(:id)
admin_ids = User.where(:admin => true).pluck(:id) admin_ids = User.where(admin: true).pluck(:id)
projects_ids = Project.pluck(:id) projects_ids = Project.pluck(:id)
puts "Importing #{user_ids.size} users into #{projects_ids.size} projects" puts "Importing #{user_ids.size} users into #{projects_ids.size} projects"
......
namespace :gitlab do namespace :gitlab do
namespace :cleanup do namespace :cleanup do
desc "GITLAB | Cleanup | Clean namespaces" desc "GITLAB | Cleanup | Clean namespaces"
task :dirs => :environment do task dirs: :environment do
warn_user_is_not_gitlab warn_user_is_not_gitlab
remove_flag = ENV['REMOVE'] remove_flag = ENV['REMOVE']
...@@ -44,7 +44,7 @@ namespace :gitlab do ...@@ -44,7 +44,7 @@ namespace :gitlab do
end end
desc "GITLAB | Cleanup | Clean respositories" desc "GITLAB | Cleanup | Clean respositories"
task :repos => :environment do task repos: :environment do
warn_user_is_not_gitlab warn_user_is_not_gitlab
remove_flag = ENV['REMOVE'] remove_flag = ENV['REMOVE']
......
...@@ -10,7 +10,7 @@ namespace :gitlab do ...@@ -10,7 +10,7 @@ namespace :gitlab do
# * existing projects will be skipped # * existing projects will be skipped
# #
desc "GITLAB | Import bare repositories from git_host -> base_path into GitLab project instance" desc "GITLAB | Import bare repositories from git_host -> base_path into GitLab project instance"
task :repos => :environment do task repos: :environment do
git_base_path = Gitlab.config.gitlab_shell.repos_path git_base_path = Gitlab.config.gitlab_shell.repos_path
repos_to_import = Dir.glob(git_base_path + '/*') repos_to_import = Dir.glob(git_base_path + '/*')
...@@ -40,7 +40,7 @@ namespace :gitlab do ...@@ -40,7 +40,7 @@ namespace :gitlab do
user = User.admins.first user = User.admins.first
project_params = { project_params = {
:name => path, name: path,
} }
project = Projects::CreateContext.new(user, project_params).execute project = Projects::CreateContext.new(user, project_params).execute
......
namespace :gitlab do namespace :gitlab do
desc "GITLAB | Setup production application" desc "GITLAB | Setup production application"
task :setup => :environment do task setup: :environment do
setup_db setup_db
end end
......
namespace :gitlab do namespace :gitlab do
desc "GITLAB | Run both spinach and rspec" desc "GITLAB | Run both spinach and rspec"
task :test => ['spinach', 'spec'] task test: ['spinach', 'spec']
end end
desc "Travis run tests" desc "Travis run tests"
task :travis => [ task travis: [
:spinach, :spinach,
:spec :spec
] ]
...@@ -16,7 +16,7 @@ describe UsersProjectObserver do ...@@ -16,7 +16,7 @@ describe UsersProjectObserver do
it "should send email to user" do it "should send email to user" do
subject.should_receive(:notification) subject.should_receive(:notification)
Event.stub(:create => true) Event.stub(create: true)
create(:users_project) create(:users_project)
end end
......
...@@ -85,17 +85,17 @@ describe Gitlab::API do ...@@ -85,17 +85,17 @@ describe Gitlab::API do
end end
it "should not create group, duplicate" do 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 response.status.should == 404
end end
it "should return 400 bad request error if name not given" do 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 response.status.should == 400
end end
it "should return 400 bad request error if path not given" do 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 response.status.should == 400
end end
end end
......
...@@ -56,15 +56,15 @@ describe Admin::UsersController, "routing" do ...@@ -56,15 +56,15 @@ describe Admin::UsersController, "routing" do
end end
end end
# team_admin_project GET /admin/projects/:id/team(.:format) admin/projects#team {: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=>/[^\/]+/} # 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=>/[^\/]+/} # admin_projects GET /admin/projects(.:format) admin/projects#index {id: /[^\/]+/}
# POST /admin/projects(.:format) admin/projects#create {:id=>/[^\/]+/} # POST /admin/projects(.:format) admin/projects#create {id: /[^\/]+/}
# new_admin_project GET /admin/projects/new(.:format) admin/projects#new {: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=>/[^\/]+/} # edit_admin_project GET /admin/projects/:id/edit(.:format) admin/projects#edit {id: /[^\/]+/}
# admin_project GET /admin/projects/:id(.:format) admin/projects#show {:id=>/[^\/]+/} # admin_project GET /admin/projects/:id(.:format) admin/projects#show {id: /[^\/]+/}
# PUT /admin/projects/:id(.:format) admin/projects#update {:id=>/[^\/]+/} # PUT /admin/projects/:id(.:format) admin/projects#update {id: /[^\/]+/}
# DELETE /admin/projects/:id(.:format) admin/projects#destroy {:id=>/[^\/]+/} # DELETE /admin/projects/:id(.:format) admin/projects#destroy {id: /[^\/]+/}
describe Admin::ProjectsController, "routing" do describe Admin::ProjectsController, "routing" do
it "to #index" do it "to #index" do
get("/admin/projects").should route_to('admin/projects#index') get("/admin/projects").should route_to('admin/projects#index')
...@@ -75,9 +75,9 @@ describe Admin::ProjectsController, "routing" do ...@@ -75,9 +75,9 @@ describe Admin::ProjectsController, "routing" do
end end
end end
# edit_admin_project_member GET /admin/projects/:project_id/members/:id/edit(.:format) admin/projects/members#edit {: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=>/[^\/]+/} # 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=>/[^\/]+/} # DELETE /admin/projects/:project_id/members/:id(.:format) admin/projects/members#destroy {id: /[^\/]+/, project_id: /[^\/]+/}
describe Admin::Projects::MembersController, "routing" do describe Admin::Projects::MembersController, "routing" do
it "to #edit" do it "to #edit" do
get("/admin/projects/test/members/1/edit").should route_to('admin/projects/members#edit', project_id: 'test', id: '1') get("/admin/projects/test/members/1/edit").should route_to('admin/projects/members#edit', project_id: 'test', id: '1')
......
...@@ -279,7 +279,7 @@ describe HooksController, "routing" do ...@@ -279,7 +279,7 @@ describe HooksController, "routing" do
end end
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 describe CommitController, "routing" do
it "to #show" do it "to #show" do
get("/gitlabhq/commit/4246fb").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb') get("/gitlabhq/commit/4246fb").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb')
...@@ -375,7 +375,7 @@ describe NotesController, "routing" do ...@@ -375,7 +375,7 @@ describe NotesController, "routing" do
end end
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 describe BlameController, "routing" do
it "to #show" 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') 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 ...@@ -383,7 +383,7 @@ describe BlameController, "routing" do
end end
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 describe BlobController, "routing" do
it "to #show" 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') 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 ...@@ -392,7 +392,7 @@ describe BlobController, "routing" do
end end
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 describe TreeController, "routing" do
it "to #show" 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') 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 ...@@ -400,9 +400,9 @@ describe TreeController, "routing" do
end end
end end
# project_compare_index GET /:project_id/compare(.:format) compare#index {: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=>/[^\/]+/} # 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 /:project_id/compare/:from...:to(.:format) compare#show {from: /.+/, to: /.+/, id: /[^\/]+/, project_id: /[^\/]+/}
describe CompareController, "routing" do describe CompareController, "routing" do
it "to #index" do it "to #index" do
get("/gitlabhq/compare").should route_to('compare#index', project_id: 'gitlabhq') get("/gitlabhq/compare").should route_to('compare#index', project_id: 'gitlabhq')
......
...@@ -22,21 +22,21 @@ describe 'gitlab:app namespace rake task' do ...@@ -22,21 +22,21 @@ describe 'gitlab:app namespace rake task' do
context 'gitlab version' do context 'gitlab version' do
before do before do
Dir.stub :glob => [] Dir.stub glob: []
Dir.stub :chdir Dir.stub :chdir
File.stub :exists? => true File.stub exists?: true
Kernel.stub :system => true Kernel.stub system: true
end end
let(:gitlab_version) { %x{git rev-parse HEAD}.gsub(/\n/,"") } let(:gitlab_version) { %x{git rev-parse HEAD}.gsub(/\n/,"") }
it 'should fail on mismach' do 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 expect { run_rake_task }.to raise_error SystemExit
end end
it 'should invoke restoration on mach' do 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:db:restore"].should_receive :invoke
Rake::Task["gitlab:backup:repo:restore"].should_receive :invoke Rake::Task["gitlab:backup:repo:restore"].should_receive :invoke
expect { run_rake_task }.to_not raise_error SystemExit expect { run_rake_task }.to_not raise_error SystemExit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment