summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2012-08-10 18:07:50 -0400
committerRobert Speicher <rspeicher@gmail.com>2012-08-10 18:25:15 -0400
commit775418918782d5284000ed0bfea364458c748567 (patch)
treec31e3633a3bcbed17b000f0165cf35edad41f7ca /spec/requests
parent1413c23c502d5a5cbc9b81f553a245103c1d6e50 (diff)
downloadgitlab-ce-775418918782d5284000ed0bfea364458c748567.tar.gz
Fully embrace Ruby 1.9 hash syntax
Didn't bother with files in db/, config/, or features/
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/admin/admin_hooks_spec.rb6
-rw-r--r--spec/requests/admin/admin_projects_spec.rb16
-rw-r--r--spec/requests/admin/admin_users_spec.rb16
-rw-r--r--spec/requests/atom/dashboard_issues_spec.rb34
-rw-r--r--spec/requests/atom/dashboard_spec.rb6
-rw-r--r--spec/requests/atom/issues_spec.rb20
-rw-r--r--spec/requests/gitlab_flavored_markdown_spec.rb80
-rw-r--r--spec/requests/hooks_spec.rb6
-rw-r--r--spec/requests/issues_spec.rb30
-rw-r--r--spec/requests/projects_deploy_keys_spec.rb8
-rw-r--r--spec/requests/projects_spec.rb8
-rw-r--r--spec/requests/search_spec.rb2
-rw-r--r--spec/requests/security/project_access_spec.rb6
-rw-r--r--spec/requests/snippets_spec.rb20
14 files changed, 129 insertions, 129 deletions
diff --git a/spec/requests/admin/admin_hooks_spec.rb b/spec/requests/admin/admin_hooks_spec.rb
index e8a345b689f..2f026aabab8 100644
--- a/spec/requests/admin/admin_hooks_spec.rb
+++ b/spec/requests/admin/admin_hooks_spec.rb
@@ -3,8 +3,8 @@ require 'spec_helper'
describe "Admin::Hooks" do
before do
@project = Factory :project,
- :name => "LeGiT",
- :code => "LGT"
+ name: "LeGiT",
+ code: "LGT"
login_as :admin
@system_hook = Factory :system_hook
@@ -30,7 +30,7 @@ describe "Admin::Hooks" do
before do
@url = Faker::Internet.uri("http")
visit admin_hooks_path
- fill_in "hook_url", :with => @url
+ fill_in "hook_url", with: @url
expect { click_button "Add System Hook" }.to change(SystemHook, :count).by(1)
end
diff --git a/spec/requests/admin/admin_projects_spec.rb b/spec/requests/admin/admin_projects_spec.rb
index 37cb7d6704d..0ce66f5f868 100644
--- a/spec/requests/admin/admin_projects_spec.rb
+++ b/spec/requests/admin/admin_projects_spec.rb
@@ -3,8 +3,8 @@ require 'spec_helper'
describe "Admin::Projects" do
before do
@project = Factory :project,
- :name => "LeGiT",
- :code => "LGT"
+ name: "LeGiT",
+ code: "LGT"
login_as :admin
end
@@ -47,8 +47,8 @@ describe "Admin::Projects" do
describe "Update project" do
before do
- fill_in "project_name", :with => "Big Bang"
- fill_in "project_code", :with => "BB1"
+ fill_in "project_name", with: "Big Bang"
+ fill_in "project_code", with: "BB1"
click_button "Save Project"
@project.reload
end
@@ -85,9 +85,9 @@ describe "Admin::Projects" do
describe "POST /admin/projects" do
before do
visit new_admin_project_path
- fill_in 'project_name', :with => 'NewProject'
- fill_in 'project_code', :with => 'NPR'
- fill_in 'project_path', :with => 'gitlabhq_1'
+ fill_in 'project_name', with: 'NewProject'
+ fill_in 'project_code', with: 'NPR'
+ fill_in 'project_path', with: 'gitlabhq_1'
expect { click_button "Create project" }.to change { Project.count }.by(1)
@project = Project.last
end
@@ -109,7 +109,7 @@ describe "Admin::Projects" do
end
it "should create new user" do
- select @new_user.name, :from => "user_ids"
+ select @new_user.name, from: "user_ids"
expect { click_button "Add" }.to change { UsersProject.count }.by(1)
page.should have_content @new_user.name
current_path.should == admin_project_path(@project)
diff --git a/spec/requests/admin/admin_users_spec.rb b/spec/requests/admin/admin_users_spec.rb
index ba6831e3d8b..68358bf0a0f 100644
--- a/spec/requests/admin/admin_users_spec.rb
+++ b/spec/requests/admin/admin_users_spec.rb
@@ -22,10 +22,10 @@ describe "Admin::Users" do
before do
@password = "123ABC"
visit new_admin_user_path
- fill_in "user_name", :with => "Big Bang"
- fill_in "user_email", :with => "bigbang@mail.com"
- fill_in "user_password", :with => @password
- fill_in "user_password_confirmation", :with => @password
+ fill_in "user_name", with: "Big Bang"
+ fill_in "user_email", with: "bigbang@mail.com"
+ fill_in "user_password", with: @password
+ fill_in "user_password_confirmation", with: @password
end
it "should create new user" do
@@ -40,7 +40,7 @@ describe "Admin::Users" do
end
it "should call send mail" do
- Notify.should_receive(:new_user_email).and_return(stub(:deliver => true))
+ Notify.should_receive(:new_user_email).and_return(stub(deliver: true))
User.observers.enable :user_observer do
click_button "Save"
@@ -88,8 +88,8 @@ describe "Admin::Users" do
describe "Update user" do
before do
- fill_in "user_name", :with => "Big Bang"
- fill_in "user_email", :with => "bigbang@mail.com"
+ fill_in "user_name", with: "Big Bang"
+ fill_in "user_email", with: "bigbang@mail.com"
check "user_admin"
click_button "Save"
end
@@ -114,7 +114,7 @@ describe "Admin::Users" do
end
it "should create new user" do
- select @new_project.name, :from => "project_ids"
+ select @new_project.name, from: "project_ids"
expect { click_button "Add" }.to change { UsersProject.count }.by(1)
page.should have_content @new_project.name
current_path.should == admin_user_path(@user)
diff --git a/spec/requests/atom/dashboard_issues_spec.rb b/spec/requests/atom/dashboard_issues_spec.rb
index 7260dcf47bf..9b4ffc0e326 100644
--- a/spec/requests/atom/dashboard_issues_spec.rb
+++ b/spec/requests/atom/dashboard_issues_spec.rb
@@ -7,40 +7,40 @@ describe "User Issues Dashboard" do
login_as :user
@project1 = Factory :project,
- :path => "project1",
- :code => "TEST1"
+ path: "project1",
+ code: "TEST1"
@project2 = Factory :project,
- :path => "project2",
- :code => "TEST2"
+ path: "project2",
+ code: "TEST2"
@project1.add_access(@user, :read, :write)
@project2.add_access(@user, :read, :write)
@issue1 = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => @project1
+ author: @user,
+ assignee: @user,
+ project: @project1
@issue2 = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => @project2
+ author: @user,
+ assignee: @user,
+ project: @project2
visit dashboard_issues_path
end
- describe "atom feed", :js => false do
+ describe "atom feed", js: false do
it "should render atom feed via private token" do
logout
- visit dashboard_issues_path(:atom, :private_token => @user.private_token)
+ visit dashboard_issues_path(:atom, private_token: @user.private_token)
page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", :text => "#{@user.name} issues")
- page.body.should have_selector("author email", :text => @issue1.author_email)
- page.body.should have_selector("entry summary", :text => @issue1.title)
- page.body.should have_selector("author email", :text => @issue2.author_email)
- page.body.should have_selector("entry summary", :text => @issue2.title)
+ page.body.should have_selector("title", text: "#{@user.name} issues")
+ page.body.should have_selector("author email", text: @issue1.author_email)
+ page.body.should have_selector("entry summary", text: @issue1.title)
+ page.body.should have_selector("author email", text: @issue2.author_email)
+ page.body.should have_selector("entry summary", text: @issue2.title)
end
end
end
diff --git a/spec/requests/atom/dashboard_spec.rb b/spec/requests/atom/dashboard_spec.rb
index 4db8ce49ff7..00c7a5255ca 100644
--- a/spec/requests/atom/dashboard_spec.rb
+++ b/spec/requests/atom/dashboard_spec.rb
@@ -5,7 +5,7 @@ describe "User Dashboard" do
describe "GET /" do
before do
- @project = Factory :project, :owner => @user
+ @project = Factory :project, owner: @user
@project.add_access(@user, :read)
visit dashboard_path
end
@@ -13,14 +13,14 @@ describe "User Dashboard" do
it "should render projects atom feed via private token" do
logout
- visit dashboard_path(:atom, :private_token => @user.private_token)
+ visit dashboard_path(:atom, private_token: @user.private_token)
page.body.should have_selector("feed title")
end
it "should not render projects page via private token" do
logout
- visit dashboard_path(:private_token => @user.private_token)
+ visit dashboard_path(private_token: @user.private_token)
current_path.should == new_user_session_path
end
end
diff --git a/spec/requests/atom/issues_spec.rb b/spec/requests/atom/issues_spec.rb
index 8d0b6c4f3fd..468d1b2260a 100644
--- a/spec/requests/atom/issues_spec.rb
+++ b/spec/requests/atom/issues_spec.rb
@@ -11,9 +11,9 @@ describe "Issues" do
describe "GET /issues" do
before do
@issue = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => project
+ author: @user,
+ assignee: @user,
+ project: project
visit project_issues_path(project)
end
@@ -22,19 +22,19 @@ describe "Issues" do
visit project_issues_path(project, :atom)
page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", :text => "#{project.name} issues")
- page.body.should have_selector("author email", :text => @issue.author_email)
- page.body.should have_selector("entry summary", :text => @issue.title)
+ page.body.should have_selector("title", text: "#{project.name} issues")
+ page.body.should have_selector("author email", text: @issue.author_email)
+ page.body.should have_selector("entry summary", text: @issue.title)
end
it "should render atom feed via private token" do
logout
- visit project_issues_path(project, :atom, :private_token => @user.private_token)
+ visit project_issues_path(project, :atom, private_token: @user.private_token)
page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", :text => "#{project.name} issues")
- page.body.should have_selector("author email", :text => @issue.author_email)
- page.body.should have_selector("entry summary", :text => @issue.title)
+ page.body.should have_selector("title", text: "#{project.name} issues")
+ page.body.should have_selector("author email", text: @issue.author_email)
+ page.body.should have_selector("entry summary", text: @issue.title)
end
end
end
diff --git a/spec/requests/gitlab_flavored_markdown_spec.rb b/spec/requests/gitlab_flavored_markdown_spec.rb
index 06ae6841d4f..1076e90c42b 100644
--- a/spec/requests/gitlab_flavored_markdown_spec.rb
+++ b/spec/requests/gitlab_flavored_markdown_spec.rb
@@ -2,10 +2,10 @@ require 'spec_helper'
describe "Gitlab Flavored Markdown" do
let(:project) { Factory :project }
- let(:issue) { Factory :issue, :project => project }
- let(:merge_request) { Factory :merge_request, :project => project }
+ let(:issue) { Factory :issue, project: project }
+ let(:merge_request) { Factory :merge_request, project: project }
let(:fred) do
- u = Factory :user, :name => "fred"
+ u = Factory :user, name: "fred"
project.users << u
u
end
@@ -19,7 +19,7 @@ describe "Gitlab Flavored Markdown" do
@test_file = "gfm_test_file"
i.add(@test_file, "foo\nbar\n")
# add commit with gfm
- i.commit("fix ##{issue.id}\n\nask @#{fred.name} for details", :head => @branch_name)
+ i.commit("fix ##{issue.id}\n\nask @#{fred.name} for details", head: @branch_name)
# add test tag
@tag_name = "gfm-test-tag"
@@ -27,8 +27,8 @@ describe "Gitlab Flavored Markdown" do
end
after do
# delete test branch and tag
- project.repo.git.native(:branch, {:D => true}, @branch_name)
- project.repo.git.native(:tag, {:d => true}, @tag_name)
+ project.repo.git.native(:branch, {D: true}, @branch_name)
+ project.repo.git.native(:tag, {d: true}, @tag_name)
project.repo.gc_auto
end
@@ -42,25 +42,25 @@ describe "Gitlab Flavored Markdown" do
describe "for commits" do
it "should render title in commits#index" do
- visit project_commits_path(project, :ref => @branch_name)
+ visit project_commits_path(project, ref: @branch_name)
page.should have_link("##{issue.id}")
end
it "should render title in commits#show" do
- visit project_commit_path(project, :id => commit.id)
+ visit project_commit_path(project, id: commit.id)
page.should have_link("##{issue.id}")
end
it "should render description in commits#show" do
- visit project_commit_path(project, :id => commit.id)
+ visit project_commit_path(project, id: commit.id)
page.should have_link("@#{fred.name}")
end
- it "should render title in refs#tree", :js => true do
- visit tree_project_ref_path(project, :id => @branch_name)
+ it "should render title in refs#tree", js: true do
+ visit tree_project_ref_path(project, id: @branch_name)
within(".tree_commit") do
page.should have_link("##{issue.id}")
@@ -68,7 +68,7 @@ describe "Gitlab Flavored Markdown" do
end
it "should render title in refs#blame" do
- visit blame_file_project_ref_path(project, :id => @branch_name, :path => @test_file)
+ visit blame_file_project_ref_path(project, id: @branch_name, path: @test_file)
within(".blame_commit") do
page.should have_link("##{issue.id}")
@@ -92,15 +92,15 @@ describe "Gitlab Flavored Markdown" do
describe "for issues" do
before do
@other_issue = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => project
+ author: @user,
+ assignee: @user,
+ project: project
@issue = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => project,
- :title => "fix ##{@other_issue.id}",
- :description => "ask @#{fred.name} for details"
+ author: @user,
+ assignee: @user,
+ project: project,
+ title: "fix ##{@other_issue.id}",
+ description: "ask @#{fred.name} for details"
end
it "should render subject in issues#index" do
@@ -126,8 +126,8 @@ describe "Gitlab Flavored Markdown" do
describe "for merge requests" do
before do
@merge_request = Factory :merge_request,
- :project => project,
- :title => "fix ##{issue.id}"
+ project: project,
+ title: "fix ##{issue.id}"
end
it "should render title in merge_requests#index" do
@@ -147,9 +147,9 @@ describe "Gitlab Flavored Markdown" do
describe "for milestones" do
before do
@milestone = Factory :milestone,
- :project => project,
- :title => "fix ##{issue.id}",
- :description => "ask @#{fred.name} for details"
+ project: project,
+ title: "fix ##{issue.id}",
+ description: "ask @#{fred.name} for details"
end
it "should render title in milestones#index" do
@@ -173,45 +173,45 @@ describe "Gitlab Flavored Markdown" do
describe "for notes" do
- it "should render in commits#show", :js => true do
- visit project_commit_path(project, :id => commit.id)
- fill_in "note_note", :with => "see ##{issue.id}"
+ it "should render in commits#show", js: true do
+ visit project_commit_path(project, id: commit.id)
+ fill_in "note_note", with: "see ##{issue.id}"
click_button "Add Comment"
page.should have_link("##{issue.id}")
end
- it "should render in issue#show", :js => true do
+ it "should render in issue#show", js: true do
visit project_issue_path(project, issue)
- fill_in "note_note", :with => "see ##{issue.id}"
+ fill_in "note_note", with: "see ##{issue.id}"
click_button "Add Comment"
page.should have_link("##{issue.id}")
end
- it "should render in merge_request#show", :js => true do
+ it "should render in merge_request#show", js: true do
visit project_merge_request_path(project, merge_request)
- fill_in "note_note", :with => "see ##{issue.id}"
+ fill_in "note_note", with: "see ##{issue.id}"
click_button "Add Comment"
page.should have_link("##{issue.id}")
end
- it "should render in projects#wall", :js => true do
+ it "should render in projects#wall", js: true do
visit wall_project_path(project)
- fill_in "note_note", :with => "see ##{issue.id}"
+ fill_in "note_note", with: "see ##{issue.id}"
click_button "Add Comment"
page.should have_link("##{issue.id}")
end
- it "should render in wikis#index", :js => true do
+ it "should render in wikis#index", js: true do
visit project_wiki_path(project, :index)
- fill_in "Title", :with => 'Test title'
- fill_in "Content", :with => '[link test](test)'
+ fill_in "Title", with: 'Test title'
+ fill_in "Content", with: '[link test](test)'
click_on "Save"
- fill_in "note_note", :with => "see ##{issue.id}"
+ fill_in "note_note", with: "see ##{issue.id}"
click_button "Add Comment"
page.should have_link("##{issue.id}")
@@ -222,8 +222,8 @@ describe "Gitlab Flavored Markdown" do
describe "for wikis" do
before do
visit project_wiki_path(project, :index)
- fill_in "Title", :with => "Circumvent ##{issue.id}"
- fill_in "Content", :with => "# Other pages\n\n* [Foo](foo)\n* [Bar](bar)\n\nAlso look at ##{issue.id} :-)"
+ fill_in "Title", with: "Circumvent ##{issue.id}"
+ fill_in "Content", with: "# Other pages\n\n* [Foo](foo)\n* [Bar](bar)\n\nAlso look at ##{issue.id} :-)"
click_on "Save"
end
diff --git a/spec/requests/hooks_spec.rb b/spec/requests/hooks_spec.rb
index 05432f13f3c..7cfe7cfe849 100644
--- a/spec/requests/hooks_spec.rb
+++ b/spec/requests/hooks_spec.rb
@@ -9,7 +9,7 @@ describe "Hooks" do
describe "GET index" do
it "should be available" do
- @hook = Factory :project_hook, :project => @project
+ @hook = Factory :project_hook, project: @project
visit project_hooks_path(@project)
page.should have_content "Hooks"
page.should have_content @hook.url
@@ -20,7 +20,7 @@ describe "Hooks" do
before do
@url = Faker::Internet.uri("http")
visit project_hooks_path(@project)
- fill_in "hook_url", :with => @url
+ fill_in "hook_url", with: @url
expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1)
end
@@ -32,7 +32,7 @@ describe "Hooks" do
describe "Test" do
before do
- @hook = Factory :project_hook, :project => @project
+ @hook = Factory :project_hook, project: @project
stub_request(:post, @hook.url)
visit project_hooks_path(@project)
click_link "Test Hook"
diff --git a/spec/requests/issues_spec.rb b/spec/requests/issues_spec.rb
index ad7b0432f42..24c21db8476 100644
--- a/spec/requests/issues_spec.rb
+++ b/spec/requests/issues_spec.rb
@@ -11,12 +11,12 @@ describe "Issues" do
project.add_access(@user2, :read, :write)
end
- describe "Edit issue", :js => true do
+ describe "Edit issue", js: true do
before do
@issue = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => project
+ author: @user,
+ assignee: @user,
+ project: project
visit project_issues_path(project)
click_link "Edit"
end
@@ -27,8 +27,8 @@ describe "Issues" do
describe "fill in" do
before do
- fill_in "issue_title", :with => "bug 345"
- fill_in "issue_description", :with => "bug description"
+ fill_in "issue_title", with: "bug 345"
+ fill_in "issue_description", with: "bug description"
end
it { expect { click_button "Save changes" }.to_not change {Issue.count} }
@@ -43,14 +43,14 @@ describe "Issues" do
end
end
- describe "Search issue", :js => true do
+ describe "Search issue", js: true do
before do
['foobar', 'foobar2', 'gitlab'].each do |title|
@issue = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => project,
- :title => title
+ author: @user,
+ assignee: @user,
+ project: project,
+ title: title
@issue.save
end
end
@@ -62,7 +62,7 @@ describe "Issues" do
visit project_issues_path(project)
click_link 'Closed'
- fill_in 'issue_search', :with => 'foobar'
+ fill_in 'issue_search', with: 'foobar'
page.should have_content 'foobar'
page.should_not have_content 'foobar2'
@@ -71,7 +71,7 @@ describe "Issues" do
it "should search for term and return the correct results" do
visit project_issues_path(project)
- fill_in 'issue_search', :with => 'foobar'
+ fill_in 'issue_search', with: 'foobar'
page.should have_content 'foobar'
page.should have_content 'foobar2'
@@ -80,8 +80,8 @@ describe "Issues" do
it "should return all results if term has been cleared" do
visit project_issues_path(project)
- fill_in "issue_search", :with => "foobar"
- # Because fill_in, :with => "" triggers nothing we need to trigger a keyup event
+ fill_in "issue_search", with: "foobar"
+ # Because fill_in, with: "" triggers nothing we need to trigger a keyup event
page.execute_script("$('.issue_search').val('').keyup();");
page.should have_content 'foobar'
diff --git a/spec/requests/projects_deploy_keys_spec.rb b/spec/requests/projects_deploy_keys_spec.rb
index 580e55229e1..0fea7b46ce2 100644
--- a/spec/requests/projects_deploy_keys_spec.rb
+++ b/spec/requests/projects_deploy_keys_spec.rb
@@ -10,7 +10,7 @@ describe "Projects", "DeployKeys" do
describe "GET /keys" do
before do
- @key = Factory :key, :project => project
+ @key = Factory :key, project: project
visit project_deploy_keys_path(project)
end
@@ -41,8 +41,8 @@ describe "Projects", "DeployKeys" do
describe "fill in" do
before do
- fill_in "key_title", :with => "laptop"
- fill_in "key_key", :with => "publickey234="
+ fill_in "key_title", with: "laptop"
+ fill_in "key_key", with: "publickey234="
end
it { expect { click_button "Save" }.to change {Key.count}.by(1) }
@@ -57,7 +57,7 @@ describe "Projects", "DeployKeys" do
describe "Show page" do
before do
- @key = Factory :key, :project => project
+ @key = Factory :key, project: project
visit project_deploy_key_path(project, @key)
end
diff --git a/spec/requests/projects_spec.rb b/spec/requests/projects_spec.rb
index f96affc75bc..63f8a696754 100644
--- a/spec/requests/projects_spec.rb
+++ b/spec/requests/projects_spec.rb
@@ -5,7 +5,7 @@ describe "Projects" do
describe "GET /projects/show" do
before do
- @project = Factory :project, :owner => @user
+ @project = Factory :project, owner: @user
@project.add_access(@user, :read)
visit project_path(@project)
@@ -37,13 +37,13 @@ describe "Projects" do
describe "PUT /projects/:id" do
before do
- @project = Factory :project, :owner => @user
+ @project = Factory :project, owner: @user
@project.add_access(@user, :admin, :read)
visit edit_project_path(@project)
- fill_in 'project_name', :with => 'Awesome'
- fill_in 'project_code', :with => 'gitlabhq'
+ fill_in 'project_name', with: 'Awesome'
+ fill_in 'project_code', with: 'gitlabhq'
click_button "Save"
@project = @project.reload
end
diff --git a/spec/requests/search_spec.rb b/spec/requests/search_spec.rb
index 377bc215a04..537c4d0c64c 100644
--- a/spec/requests/search_spec.rb
+++ b/spec/requests/search_spec.rb
@@ -6,7 +6,7 @@ describe "Search" do
@project = Factory :project
@project.add_access(@user, :read)
visit search_path
- fill_in "search", :with => @project.name[0..3]
+ fill_in "search", with: @project.name[0..3]
click_button "Search"
end
diff --git a/spec/requests/security/project_access_spec.rb b/spec/requests/security/project_access_spec.rb
index bcca42f5298..d503cf857b5 100644
--- a/spec/requests/security/project_access_spec.rb
+++ b/spec/requests/security/project_access_spec.rb
@@ -20,9 +20,9 @@ describe "Application access" do
@u2 = Factory :user
@u3 = Factory :user
# full access
- @project.users_projects.create(:user => @u1, :project_access => UsersProject::MASTER)
+ @project.users_projects.create(user: @u1, project_access: UsersProject::MASTER)
# readonly
- @project.users_projects.create(:user => @u3, :project_access => UsersProject::REPORTER)
+ @project.users_projects.create(user: @u3, project_access: UsersProject::REPORTER)
end
describe "GET /project_code" do
@@ -83,7 +83,7 @@ describe "Application access" do
before do
@commit = @project.commit
@path = @commit.tree.contents.select { |i| i.is_a?(Grit::Blob)}.first.name
- @blob_path = blob_project_ref_path(@project, @commit.id, :path => @path)
+ @blob_path = blob_project_ref_path(@project, @commit.id, path: @path)
end
it { @blob_path.should be_allowed_for @u1 }
diff --git a/spec/requests/snippets_spec.rb b/spec/requests/snippets_spec.rb
index 9b9bb0e96c5..6b993660507 100644
--- a/spec/requests/snippets_spec.rb
+++ b/spec/requests/snippets_spec.rb
@@ -11,8 +11,8 @@ describe "Snippets" do
describe "GET /snippets" do
before do
@snippet = Factory :snippet,
- :author => @user,
- :project => project
+ author: @user,
+ project: project
visit project_snippets_path(project)
end
@@ -50,9 +50,9 @@ describe "Snippets" do
describe "fill in" do
before do
- fill_in "snippet_title", :with => "login function"
- fill_in "snippet_file_name", :with => "test.rb"
- fill_in "snippet_content", :with => "def login; end"
+ fill_in "snippet_title", with: "login function"
+ fill_in "snippet_file_name", with: "test.rb"
+ fill_in "snippet_content", with: "def login; end"
end
it { expect { click_button "Save" }.to change {Snippet.count}.by(1) }
@@ -69,8 +69,8 @@ describe "Snippets" do
describe "Edit snippet" do
before do
@snippet = Factory :snippet,
- :author => @user,
- :project => project
+ author: @user,
+ project: project
visit project_snippet_path(project, @snippet)
click_link "Edit"
end
@@ -81,9 +81,9 @@ describe "Snippets" do
describe "fill in" do
before do
- fill_in "snippet_title", :with => "login function"
- fill_in "snippet_file_name", :with => "test.rb"
- fill_in "snippet_content", :with => "def login; end"
+ fill_in "snippet_title", with: "login function"
+ fill_in "snippet_file_name", with: "test.rb"
+ fill_in "snippet_content", with: "def login; end"
end
it { expect { click_button "Save" }.to_not change {Snippet.count} }