Skip to content

Commit

Permalink
テストを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Kassy0220 committed Aug 8, 2023
1 parent fed9c6f commit a777540
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/models/product_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class ProductTest < ActiveSupport::TestCase
assert_not_includes product_id_list, no_replied_wip_product.id
end

test '#updated_after_submission? return true when product is updated after submission' do
test '#notification_type return :product_update when product is updated after submission' do
product = Product.create!(
body: 'test',
user: users(:kimura),
Expand All @@ -170,15 +170,15 @@ class ProductTest < ActiveSupport::TestCase
)

product.update!(body: 'product is updated.')
assert product.updated_after_submission?
assert_equal :product_update, product.notification_type

product.update!(body: 'product is saved as WIP.', wip: true)

product.update!(body: 'product is reupdated.', wip: false, published_at: Time.current)
assert product.updated_after_submission?
assert_equal :product_update, product.notification_type
end

test '#updated_after_submission? return false when product is first saved as WIP then updated' do
test '#notification_type return :submitted when product is first saved as WIP then updated' do
product = Product.create!(
body: 'first saved as WIP',
user: users(:kimura),
Expand All @@ -188,6 +188,6 @@ class ProductTest < ActiveSupport::TestCase
)

product.update!(body: 'product is updated.', wip: false, published_at: Time.current)
assert_not product.updated_after_submission?
assert_equal :submitted, product.notification_type
end
end

0 comments on commit a777540

Please sign in to comment.