Skip to content

Commit

Permalink
期待した順番で返ってくることのテストを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
Aseiide committed Mar 28, 2022
1 parent 4dc8aa3 commit d0105c9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions test/integration/api/products_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ class API::ProductsTest < ActionDispatch::IntegrationTest
assert_response :ok
end

test 'コメント有り→コメント無しの順番で返ってくること' do
test ' should return products in order ' do
token = create_token('machida', 'testtest')
end

test 'コメント無の提出物が提出日の昇順で返ってくること' do

end

test 'コメント有の提出物がコメント日時の昇順で返ってくること' do
get api_products_self_assigned_index_path(format: :json),
headers: { 'Authorization' => "Bearer #{token}" }

expected = products(:product15, :product63, :product62, :product64).map { |product| product.practice.title }
actual = response.parsed_body['products'].map { |product| product['practice']['title'] }
assert_equal expected, actual
end
end

0 comments on commit d0105c9

Please sign in to comment.