Skip to content

Commit

Permalink
Replace with 1.9 hash syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanPorta committed Nov 29, 2014
1 parent 4d9297f commit 68f9cb6
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion db/migrate/20141028211318_create_devices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ def change
t.timestamps
end

add_index :devices, :token, :unique => true
add_index :devices, :token, unique: true
end
end
2 changes: 1 addition & 1 deletion spec/helpers/friendships_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
# end
# end
# end
RSpec.describe FriendshipsHelper, :type => :helper do
RSpec.describe FriendshipsHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end
2 changes: 1 addition & 1 deletion spec/models/friendship_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'rails_helper'

RSpec.describe Friendship, :type => :model do
RSpec.describe Friendship, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
16 changes: 8 additions & 8 deletions spec/routing/friendships_routing_spec.rb
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
require "rails_helper"

RSpec.describe FriendshipsController, :type => :routing do
RSpec.describe FriendshipsController, type: :routing do
describe "routing" do

it "routes to #index" do
expect(:get => "/friendships").to route_to("friendships#index")
expect(get: "/friendships").to route_to("friendships#index")
end

it "routes to #new" do
expect(:get => "/friendships/new").to route_to("friendships#new")
expect(get: "/friendships/new").to route_to("friendships#new")
end

it "routes to #show" do
expect(:get => "/friendships/1").to route_to("friendships#show", :id => "1")
expect(get: "/friendships/1").to route_to("friendships#show", id: "1")
end

it "routes to #edit" do
expect(:get => "/friendships/1/edit").to route_to("friendships#edit", :id => "1")
expect(get: "/friendships/1/edit").to route_to("friendships#edit", id: "1")
end

it "routes to #create" do
expect(:post => "/friendships").to route_to("friendships#create")
expect(post: "/friendships").to route_to("friendships#create")
end

it "routes to #update" do
expect(:put => "/friendships/1").to route_to("friendships#update", :id => "1")
expect(put: "/friendships/1").to route_to("friendships#update", id: "1")
end

it "routes to #destroy" do
expect(:delete => "/friendships/1").to route_to("friendships#destroy", :id => "1")
expect(delete: "/friendships/1").to route_to("friendships#destroy", id: "1")
end

end
Expand Down
6 changes: 3 additions & 3 deletions spec/views/friendships/edit.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'rails_helper'

RSpec.describe "friendships/edit", :type => :view do
RSpec.describe "friendships/edit", type: :view do
before(:each) do
@friendship = assign(:friendship, Friendship.create!(
:user_id => 1,
:friend_id => 1
user_id: 1,
friend_id: 1
))
end

Expand Down
14 changes: 7 additions & 7 deletions spec/views/friendships/index.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
require 'rails_helper'

RSpec.describe "friendships/index", :type => :view do
RSpec.describe "friendships/index", type: :view do
before(:each) do
assign(:friendships, [
Friendship.create!(
:user_id => 1,
:friend_id => 2
user_id: 1,
friend_id: 2
),
Friendship.create!(
:user_id => 1,
:friend_id => 2
user_id: 1,
friend_id: 2
)
])
end

it "renders a list of friendships" do
render
assert_select "tr>td", :text => 1.to_s, :count => 2
assert_select "tr>td", :text => 2.to_s, :count => 2
assert_select "tr>td", text: 1.to_s, count: 2
assert_select "tr>td", text: 2.to_s, count: 2
end
end
6 changes: 3 additions & 3 deletions spec/views/friendships/new.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'rails_helper'

RSpec.describe "friendships/new", :type => :view do
RSpec.describe "friendships/new", type: :view do
before(:each) do
assign(:friendship, Friendship.new(
:user_id => 1,
:friend_id => 1
user_id: 1,
friend_id: 1
))
end

Expand Down
6 changes: 3 additions & 3 deletions spec/views/friendships/show.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'rails_helper'

RSpec.describe "friendships/show", :type => :view do
RSpec.describe "friendships/show", type: :view do
before(:each) do
@friendship = assign(:friendship, Friendship.create!(
:user_id => 1,
:friend_id => 2
user_id: 1,
friend_id: 2
))
end

Expand Down

0 comments on commit 68f9cb6

Please sign in to comment.