Skip to content

Commit c60ff79

Browse files
ytkgpirj
authored andcommitted
Update to ruby 1.9 hash syntax
1 parent ad27c14 commit c60ff79

32 files changed

+112
-112
lines changed

features/backtrace_filtering.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Feature: backtrace filtering
2121
config.filter_rails_from_backtrace!
2222
end
2323
24-
RSpec.describe "Controller", :type => :controller do
24+
RSpec.describe "Controller", type: :controller do
2525
controller do
2626
def index
2727
raise "Something went wrong."

features/channel_specs/channel_spec.feature

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Feature: channel spec
22

3-
Channel specs are marked by `:type => :channel` or if you have set
3+
Channel specs are marked by `type: :channel` or if you have set
44
`config.infer_spec_type_from_file_location!` by placing them in `spec/channels`.
55

66
A channel spec is a thin wrapper for an `ActionCable::Channel::TestCase`, and includes all
@@ -37,7 +37,7 @@ Feature: channel spec
3737
"""ruby
3838
require "rails_helper"
3939
40-
RSpec.describe ChatChannel, :type => :channel do
40+
RSpec.describe ChatChannel, type: :channel do
4141
it "successfully subscribes" do
4242
subscribe room_id: 42
4343
expect(subscription).to be_confirmed
@@ -52,7 +52,7 @@ Feature: channel spec
5252
"""ruby
5353
require "rails_helper"
5454
55-
RSpec.describe ChatChannel, :type => :channel do
55+
RSpec.describe ChatChannel, type: :channel do
5656
it "rejects subscription" do
5757
subscribe room_id: nil
5858
expect(subscription).to be_rejected
@@ -67,7 +67,7 @@ Feature: channel spec
6767
"""ruby
6868
require "rails_helper"
6969
70-
RSpec.describe ChatChannel, :type => :channel do
70+
RSpec.describe ChatChannel, type: :channel do
7171
it "successfully subscribes" do
7272
subscribe room_id: 42
7373
@@ -95,7 +95,7 @@ Feature: channel spec
9595
"""ruby
9696
require "rails_helper"
9797
98-
RSpec.describe ApplicationCable::Connection, :type => :channel do
98+
RSpec.describe ApplicationCable::Connection, type: :channel do
9999
it "successfully connects" do
100100
connect "/cable?user_id=323"
101101
expect(connection.user_id).to eq "323"
@@ -121,7 +121,7 @@ Feature: channel spec
121121
"""ruby
122122
require "rails_helper"
123123
124-
RSpec.describe ApplicationCable::Connection, :type => :channel do
124+
RSpec.describe ApplicationCable::Connection, type: :channel do
125125
it "successfully connects" do
126126
cookies.signed[:user_id] = "324"
127127
@@ -149,7 +149,7 @@ Feature: channel spec
149149
"""ruby
150150
require "rails_helper"
151151
152-
RSpec.describe ApplicationCable::Connection, :type => :channel do
152+
RSpec.describe ApplicationCable::Connection, type: :channel do
153153
it "successfully connects" do
154154
connect "/cable", headers: { "X-USER-ID" => "325" }
155155
expect(connection.user_id).to eq "325"
@@ -175,7 +175,7 @@ Feature: channel spec
175175
"""ruby
176176
require "rails_helper"
177177
178-
RSpec.describe ApplicationCable::Connection, :type => :channel do
178+
RSpec.describe ApplicationCable::Connection, type: :channel do
179179
it "rejects connection" do
180180
expect { connect "/cable?user_id=" }.to have_rejected_connection
181181
end
@@ -204,7 +204,7 @@ Feature: channel spec
204204
"""ruby
205205
require "rails_helper"
206206
207-
RSpec.describe ApplicationCable::Connection, :type => :channel do
207+
RSpec.describe ApplicationCable::Connection, type: :channel do
208208
it "disconnects" do
209209
connect "/cable?user_id=42"
210210
expect { disconnect }.to output(/User 42 disconnected/).to_stdout

features/controller_specs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Controller specs are marked by `:type => :controller` or if you have set
1+
Controller specs are marked by `type: :controller` or if you have set
22
`config.infer_spec_type_from_file_location!` by placing them in `spec/controllers`.
33

44
A controller spec is an RSpec wrapper for a Rails functional test

features/controller_specs/anonymous_controller.feature

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Feature: anonymous controller
2020
c.infer_base_class_for_anonymous_controllers = false
2121
end
2222

23-
RSpec.describe BaseController, :type => :controller do
23+
RSpec.describe BaseController, type: :controller do
2424
controller do
2525
def index; end
2626

@@ -48,7 +48,7 @@ Feature: anonymous controller
4848
end
4949
end
5050
51-
RSpec.describe ApplicationController, :type => :controller do
51+
RSpec.describe ApplicationController, type: :controller do
5252
controller do
5353
def index
5454
raise ApplicationController::AccessDenied
@@ -83,7 +83,7 @@ Feature: anonymous controller
8383
end
8484
end
8585
86-
RSpec.describe ApplicationController, :type => :controller do
86+
RSpec.describe ApplicationController, type: :controller do
8787
controller do
8888
def index
8989
raise ApplicationController::AccessDenied
@@ -122,7 +122,7 @@ Feature: anonymous controller
122122
end
123123
end
124124
125-
RSpec.describe FoosController, :type => :controller do
125+
RSpec.describe FoosController, type: :controller do
126126
controller(FoosController) do
127127
def index
128128
raise ApplicationController::AccessDenied
@@ -149,7 +149,7 @@ Feature: anonymous controller
149149
150150
class FoosController < ApplicationController; end
151151
152-
RSpec.describe FoosController, :type => :controller do
152+
RSpec.describe FoosController, type: :controller do
153153
controller do
154154
def index
155155
render :plain => "Hello World"
@@ -172,7 +172,7 @@ Feature: anonymous controller
172172
class ApplicationController < ActionController::Base; end
173173
class FoosController < ApplicationController; end
174174
175-
RSpec.describe "Access controller names", :type => :controller do
175+
RSpec.describe "Access controller names", type: :controller do
176176
controller FoosController do
177177
def index
178178
@name = self.class.name
@@ -211,7 +211,7 @@ Feature: anonymous controller
211211
end
212212
end
213213
214-
RSpec.describe ApplicationController, :type => :controller do
214+
RSpec.describe ApplicationController, type: :controller do
215215
controller do
216216
def index
217217
render :plain => ""
@@ -239,7 +239,7 @@ Feature: anonymous controller
239239
ExpectedRoutingError = ActionController::RoutingError
240240
end
241241
242-
RSpec.describe ApplicationController, :type => :controller do
242+
RSpec.describe ApplicationController, type: :controller do
243243
controller do
244244
def index
245245
render :plain => "index called"
@@ -417,7 +417,7 @@ Feature: anonymous controller
417417
"""ruby
418418
require "rails_helper"
419419
420-
RSpec.describe ApplicationController, :type => :controller do
420+
RSpec.describe ApplicationController, type: :controller do
421421
controller do
422422
def custom
423423
render :plain => "custom called"
@@ -442,7 +442,7 @@ Feature: anonymous controller
442442
class OtherController < ActionController::Base
443443
end
444444
445-
RSpec.describe OtherController, :type => :controller do
445+
RSpec.describe OtherController, type: :controller do
446446
controller do
447447
def custom
448448
render :plain => "custom called"
@@ -467,7 +467,7 @@ Feature: anonymous controller
467467
468468
class FoosController < ApplicationController; end
469469
470-
RSpec.describe ApplicationController, :type => :controller do
470+
RSpec.describe ApplicationController, type: :controller do
471471
controller FoosController do
472472
def custom
473473
render :plain => "custom called"
@@ -498,7 +498,7 @@ Feature: anonymous controller
498498
end
499499
end
500500
501-
RSpec.describe Outer::Inner::FoosController, :type => :controller do
501+
RSpec.describe Outer::Inner::FoosController, type: :controller do
502502
controller do
503503
def index
504504
@name = self.class.name
@@ -535,7 +535,7 @@ Feature: anonymous controller
535535
match "/login" => "sessions#new", :as => "login", :via => "get"
536536
end
537537
538-
RSpec.describe ApplicationController, :type => :controller do
538+
RSpec.describe ApplicationController, type: :controller do
539539
controller do
540540
def index
541541
redirect_to login_url

features/controller_specs/bypass_rescue.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Feature: bypass rescue
3030
3131
require 'controllers/gadgets_controller_spec_context'
3232
33-
RSpec.describe GadgetsController, :type => :controller do
33+
RSpec.describe GadgetsController, type: :controller do
3434
before do
3535
def controller.index
3636
raise AccessDenied
@@ -55,7 +55,7 @@ Feature: bypass rescue
5555
5656
require 'controllers/gadgets_controller_spec_context'
5757
58-
RSpec.describe GadgetsController, :type => :controller do
58+
RSpec.describe GadgetsController, type: :controller do
5959
before do
6060
def controller.index
6161
raise AccessDenied

features/controller_specs/controller_spec.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Feature: controller spec
55
"""ruby
66
require "rails_helper"
77
8-
RSpec.describe WidgetsController, :type => :controller do
8+
RSpec.describe WidgetsController, type: :controller do
99
describe "GET index" do
1010
it "has a 200 status code" do
1111
get :index
@@ -24,7 +24,7 @@ Feature: controller spec
2424
2525
RSpec.configure {|c| c.before { expect(controller).not_to be_nil }}
2626
27-
RSpec.describe WidgetsController, :type => :controller do
27+
RSpec.describe WidgetsController, type: :controller do
2828
describe "GET index" do
2929
it "doesn't matter" do
3030
end
@@ -39,7 +39,7 @@ Feature: controller spec
3939
"""ruby
4040
require "rails_helper"
4141
42-
RSpec.describe WidgetsController, :type => :controller do
42+
RSpec.describe WidgetsController, type: :controller do
4343
describe "responds to" do
4444
it "responds to html by default" do
4545
post :create, :params => { :widget => { :name => "Any Name" } }
@@ -61,7 +61,7 @@ Feature: controller spec
6161
"""ruby
6262
require "rails_helper"
6363
64-
RSpec.describe WidgetsController, :type => :controller do
64+
RSpec.describe WidgetsController, type: :controller do
6565
describe "responds to" do
6666
it "responds to html by default" do
6767
post :create, :params => { :widget => { :name => "Any Name" } }

features/controller_specs/cookies.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Feature: Cookies
1111
"""ruby
1212
require "rails_helper"
1313
14-
RSpec.describe ApplicationController, :type => :controller do
14+
RSpec.describe ApplicationController, type: :controller do
1515
controller do
1616
def clear_cookie
1717
cookies.delete(:user_name)

features/controller_specs/engine_routes.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Feature: engine routes for controllers
3333
end
3434
end
3535
36-
RSpec.describe MyEngine::WidgetsController, :type => :controller do
36+
RSpec.describe MyEngine::WidgetsController, type: :controller do
3737
routes { MyEngine::Engine.routes }
3838
3939
it "redirects to a random widget" do

features/controller_specs/isolation_from_views.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Feature: views are stubbed by default
1212
"""ruby
1313
require "rails_helper"
1414
15-
RSpec.describe WidgetsController, :type => :controller do
15+
RSpec.describe WidgetsController, type: :controller do
1616
describe "index" do
1717
it "renders the index template" do
1818
get :index
@@ -35,7 +35,7 @@ Feature: views are stubbed by default
3535
"""ruby
3636
require "rails_helper"
3737
38-
RSpec.describe WidgetsController, :type => :controller do
38+
RSpec.describe WidgetsController, type: :controller do
3939
describe "index" do
4040
it "renders the 'new' template" do
4141
get :index
@@ -52,7 +52,7 @@ Feature: views are stubbed by default
5252
"""ruby
5353
require "rails_helper"
5454
55-
RSpec.describe ThingsController, :type => :controller do
55+
RSpec.describe ThingsController, type: :controller do
5656
describe "custom_action" do
5757
it "renders an empty custom_action template" do
5858
controller.prepend_view_path 'app/views'
@@ -83,7 +83,7 @@ Feature: views are stubbed by default
8383
"""ruby
8484
require "rails_helper"
8585
86-
RSpec.describe ThingsController, :type => :controller do
86+
RSpec.describe ThingsController, type: :controller do
8787
render_views
8888
8989
it "renders the real custom_action template" do

features/controller_specs/render_views.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: render_views
88
"""ruby
99
require "rails_helper"
1010
11-
RSpec.describe WidgetsController, :type => :controller do
11+
RSpec.describe WidgetsController, type: :controller do
1212
render_views
1313
1414
describe "GET index" do
@@ -27,7 +27,7 @@ Feature: render_views
2727
"""ruby
2828
require "rails_helper"
2929
30-
RSpec.describe WidgetsController, :type => :controller do
30+
RSpec.describe WidgetsController, type: :controller do
3131
context "with render_views" do
3232
render_views
3333
@@ -101,7 +101,7 @@ Feature: render_views
101101
require "rails_helper"
102102
require "support/render_views"
103103
104-
RSpec.describe WidgetsController, :type => :controller do
104+
RSpec.describe WidgetsController, type: :controller do
105105
describe "GET index" do
106106
it "renders the index template" do
107107
get :index

features/directory_structure.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Feature: Directory Structure
145145
"""ruby
146146
require "rails_helper"
147147
148-
RSpec.describe WidgetsController, :type => :controller do
148+
RSpec.describe WidgetsController, type: :controller do
149149
it "responds successfully" do
150150
get :index
151151
expect(response.status).to eq(200)
@@ -205,7 +205,7 @@ Feature: Directory Structure
205205
206206
# Due to limitations in the Rails routing test framework, routes that
207207
# perform redirects must actually be tested via request specs
208-
RSpec.describe "/example", :type => :request do
208+
RSpec.describe "/example", type: :request do
209209
it "redirects to example.com" do
210210
get "/example"
211211
expect(response).to redirect_to("http://example.com")

features/feature_specs/feature_spec.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Feature: Feature spec
44
through an application. They should drive the application only via its external
55
interface, usually web pages.
66

7-
Feature specs are marked by `:type => :feature` or if you have set
7+
Feature specs are marked by `type: :feature` or if you have set
88
`config.infer_spec_type_from_file_location!` by placing them in
99
`spec/features`.
1010

@@ -15,15 +15,15 @@ Feature: Feature spec
1515
The `feature` and `scenario` DSL correspond to `describe` and `it`, respectively.
1616
These methods are simply aliases that allow feature specs to read more as
1717
[customer](http://c2.com/cgi/wiki?CustomerTest) and [acceptance](http://c2.com/cgi/wiki?AcceptanceTest) tests. When capybara is required it sets
18-
`:type => :feature` automatically for you.
18+
`type: :feature` automatically for you.
1919

2020
@capybara
2121
Scenario: specify creating a Widget by driving the application with capybara
2222
Given a file named "spec/features/widget_management_spec.rb" with:
2323
"""ruby
2424
require "rails_helper"
2525
26-
RSpec.feature "Widget management", :type => :feature do
26+
RSpec.feature "Widget management", type: :feature do
2727
scenario "User creates a new widget" do
2828
visit "/widgets/new"
2929

0 commit comments

Comments
 (0)