Skip to content

Commit 1930da5

Browse files
committed
Merge pull request activeadmin#2970 from justanshulsharma/master
Updated ruby 1.9 hash syntax
2 parents 66de2f8 + f214d53 commit 1930da5

File tree

148 files changed

+882
-882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+882
-882
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Then /^I should see an action item link to "([^"]*)"$/ do |link|
2-
page.should have_css('.action_item a', :text => link)
2+
page.should have_css('.action_item a', text: link)
33
end
44

55
Then /^I should not see an action item link to "([^"]*)"$/ do |link|
6-
page.should_not have_css('.action_item a', :text => link)
6+
page.should_not have_css('.action_item a', text: link)
77
end

features/step_definitions/action_link_steps.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Then /^I should see a member link to "([^"]*)"$/ do |name|
2-
page.should have_css("a.member_link", :text => name)
2+
page.should have_css("a.member_link", text: name)
33
end
44

55
Then /^I should not see a member link to "([^"]*)"$/ do |name|

features/step_definitions/additional_web_steps.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
Then /^I should see a table header with "([^"]*)"$/ do |content|
2-
page.should have_xpath('//th', :text => content)
2+
page.should have_xpath('//th', text: content)
33
end
44

55
Then /^I should not see a table header with "([^"]*)"$/ do |content|
6-
page.should_not have_xpath('//th', :text => content)
6+
page.should_not have_xpath('//th', text: content)
77
end
88

99
Then /^I should see a sortable table header with "([^"]*)"$/ do |content|
10-
page.should have_css('th.sortable', :text => content)
10+
page.should have_css('th.sortable', text: content)
1111
end
1212

1313
Then /^I should not see a sortable table header with "([^"]*)"$/ do |content|
14-
page.should_not have_css('th.sortable', :text => content)
14+
page.should_not have_css('th.sortable', text: content)
1515
end
1616

1717
Then /^I should not see a sortable table header$/ do
@@ -34,7 +34,7 @@
3434
end
3535

3636
Then /^I should see a link to "([^"]*)"$/ do |link|
37-
page.should have_xpath('//a', :text => link)
37+
page.should have_xpath('//a', text: link)
3838
end
3939

4040
Then /^an "([^"]*)" exception should be raised when I follow "([^"]*)"$/ do |error, link|
@@ -61,22 +61,22 @@
6161
end
6262

6363
Then /^I should see a fieldset titled "([^"]*)"$/ do |title|
64-
page.should have_css('fieldset legend', :text => title)
64+
page.should have_css('fieldset legend', text: title)
6565
end
6666

6767
Then /^the "([^"]*)" field should contain the option "([^"]*)"$/ do |field, option|
6868
field = find_field(field)
69-
field.should have_css("option", :text => option)
69+
field.should have_css("option", text: option)
7070
end
7171

7272
Then /^I should see the content "([^"]*)"$/ do |content|
73-
page.should have_css("#active_admin_content", :text => content)
73+
page.should have_css("#active_admin_content", text: content)
7474
end
7575

7676
Then /^I should see a validation error "([^"]*)"$/ do |error_message|
77-
page.should have_css(".inline-errors", :text => error_message)
77+
page.should have_css(".inline-errors", text: error_message)
7878
end
7979

8080
Then /^I should see a table with id "([^"]*)"$/ do |dom_id|
81-
page.should have_css('table', :id => dom_id)
81+
page.should have_css('table', id: dom_id)
8282
end

features/step_definitions/attribute_steps.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
end
1515

1616
Then /^I should not see the attribute "([^"]*)"$/ do |title|
17-
page.should_not have_css('.attributes_table th', :text => title)
17+
page.should_not have_css('.attributes_table th', text: title)
1818
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Then /^I should see a link to "([^"]*)" in the breadcrumb$/ do |text|
2-
page.should have_css('.breadcrumb > a', :text => text)
2+
page.should have_css('.breadcrumb > a', text: text)
33
end

features/step_definitions/comment_steps.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
end
99

1010
Given /^a tag with the name "([^"]*)" exists$/ do |tag_name|
11-
Tag.create(:name => tag_name)
11+
Tag.create(name: tag_name)
1212
end

features/step_definitions/dashboard_steps.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
end
88

99
Then /^I should see a dashboard widget "([^"]*)"$/ do |name|
10-
page.should have_css('.dashboard .panel h3', :text => name)
10+
page.should have_css('.dashboard .panel h3', text: name)
1111
end
1212

1313
Then /^I should not see a dashboard widget "([^"]*)"$/ do |name|
14-
page.should_not have_css('.dashboard .panel h3', :text => name)
14+
page.should_not have_css('.dashboard .panel h3', text: name)
1515
end
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def create_user(name, type = 'User')
22
first_name, last_name = name.split(' ')
3-
user = type.camelize.constantize.where(:first_name => first_name, :last_name => last_name).first_or_create(:username => name.gsub(' ', '').underscore)
3+
user = type.camelize.constantize.where(first_name: first_name, last_name: last_name).first_or_create(username: name.gsub(' ', '').underscore)
44
end
55

66
Given /^(a|\d+)( published)? posts?(?: with the title "([^"]*)")?(?: and body "([^"]*)")?(?: written by "([^"]*)")?(?: in category "([^"]*)")? exists?$/ do |count, published, title, body, user, category_name|
@@ -10,25 +10,25 @@ def create_user(name, type = 'User')
1010
category = Category.where(name: category_name).first_or_create if category_name
1111
title ||= "Hello World %i"
1212
count.times do |i|
13-
Post.create! :title => title % i, :body => body, :author => author, :published_at => published, custom_category_id: category.try(:id)
13+
Post.create! title: title % i, body: body, author: author, published_at: published, custom_category_id: category.try(:id)
1414
end
1515
end
1616

1717
Given /^a category named "([^"]*)" exists$/ do |name|
18-
Category.create! :name => name
18+
Category.create! name: name
1919
end
2020

2121
Given /^a (user|publisher) named "([^"]*)" exists$/ do |type, name|
2222
create_user name, type
2323
end
2424

2525
Given /^a store named "([^"]*)" exists$/ do |name|
26-
Store.create! :name => name
26+
Store.create! name: name
2727
end
2828

2929
Given /^I create a new post with the title "([^"]*)"$/ do |title|
3030
click_link "Posts"
3131
click_link "New Post"
32-
fill_in :title, :with => title
32+
fill_in :title, with: title
3333
click_button "Create Post"
3434
end

features/step_definitions/filter_steps.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Then /^I should see a select filter for "([^"]*)"$/ do |label|
2-
page.should have_css(".filter_select label", :text => label)
2+
page.should have_css(".filter_select label", text: label)
33
end
44

55
Then /^I should see a string filter for "([^"]*)"$/ do |label|
6-
page.should have_css(".filter_string label", :text => label)
6+
page.should have_css(".filter_string label", text: label)
77
end
88

99
Then /^I should see a date range filter for "([^"]*)"$/ do |label|
10-
page.should have_css(".filter_date_range label", :text => label)
10+
page.should have_css(".filter_date_range label", text: label)
1111
end
1212

1313
Then /^I should see the following filters:$/ do |table|

features/step_definitions/flash_steps.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
end
44

55
Then /^I should see a successful create flash$/ do
6-
page.should have_css('div.flash_notice', :text => /was successfully created/)
6+
page.should have_css('div.flash_notice', text: /was successfully created/)
77
end
88

99
Then /^I should not see a successful create flash$/ do
10-
page.should_not have_css('div.flash_notice', :text => /was successfully created/)
10+
page.should_not have_css('div.flash_notice', text: /was successfully created/)
1111
end

0 commit comments

Comments
 (0)