Skip to content

Commit

Permalink
Use fixtures for products
Browse files Browse the repository at this point in the history
  • Loading branch information
zkan committed Apr 7, 2024
1 parent 926efd2 commit 72c1865
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 4 additions & 9 deletions test/fixtures/products.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
name: MyString
description: MyString
price: 1.5

two:
name: MyString
description: MyString
price: 1.5
valid:
name: "ODDS Whole Bean Coffee"
description: "Perfect start to your day"
price: 25.00
6 changes: 1 addition & 5 deletions test/models/product_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

class ProductTest < ActiveSupport::TestCase
def setup
@product = Product.new(
name: "ODDS Whole Bean Coffee",
description: "Perfect start to your day",
price: 25.00,
)
@product = products(:valid)
end

test "valid product" do
Expand Down

0 comments on commit 72c1865

Please sign in to comment.