Skip to content

Commit

Permalink
syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
thegcat committed Jun 16, 2017
1 parent a0dd99b commit 8f0aeba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spec/controllers/carts_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}

describe '#show' do
before {Cart.find_by(id: 1) || create(:cart, id: 1)}
before { Cart.find_by(id: 1) || create(:cart, id: 1) }
before { get :show, params: { id: cart_id } }

context 'when the resource exists' do
Expand Down
6 changes: 4 additions & 2 deletions spec/controllers/products_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}

describe '#show' do
before {Product.find_by(id: 1) || create(:product, id: 1)}
before { Product.find_by(id: 1) || create(:product, id: 1) }
before { get :show, params: { id: product_id } }

context 'when the resource exists' do
Expand All @@ -32,7 +32,9 @@
before {get :index}

context 'when there are products' do
before {(1..3).each {|y| Product.find_by(id: y) || create(:product, id: y)}}
before do
(1..3).each { |y| Product.find_by(id: y) || create(:product, id: y) }
end

its(:content_type) {is_expected.to eq 'application/json'}
it {is_expected.to have_http_status(:ok)}
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/users_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}

describe '#show' do
before {User.find_by(id: 1) || create(:user, id: 1)}
before { User.find_by(id: 1) || create(:user, id: 1) }
before { get :show, params: { id: user_id } }

context 'when the resource exists' do
Expand Down

0 comments on commit 8f0aeba

Please sign in to comment.