aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/controllers/pdfresources_controller_test.rb12
-rw-r--r--test/fixtures/pdfresources.yml39
2 files changed, 35 insertions, 16 deletions
diff --git a/test/controllers/pdfresources_controller_test.rb b/test/controllers/pdfresources_controller_test.rb
index bacd96e..217b552 100644
--- a/test/controllers/pdfresources_controller_test.rb
+++ b/test/controllers/pdfresources_controller_test.rb
@@ -2,7 +2,12 @@ require "test_helper"
class PdfresourcesControllerTest < ActionDispatch::IntegrationTest
setup do
- @pdfresource = pdfresources(:one)
+ @pdfresource1 = pdfresources(:one)
+ @pdfresource2 = pdfresources(:two)
+ @pdfresource = pdfresources(:three)
+ @user = users(:one)
+ post session_url, params: { email_address: @user.email_address, password: "password" }
+ follow_redirect! # After login
end
test "should get index" do
@@ -16,6 +21,7 @@ class PdfresourcesControllerTest < ActionDispatch::IntegrationTest
end
test "should create pdfresource" do
+ skip "Not implemented yet - requires image processing tests"
assert_difference("Pdfresource.count") do
post pdfresources_url, params: { pdfresource: { age_range: @pdfresource.age_range, card_description: @pdfresource.card_description, curriculum: @pdfresource.curriculum, description: @pdfresource.description, feature_slot: @pdfresource.feature_slot, name: @pdfresource.name, price: @pdfresource.price, stripe_product_id: @pdfresource.stripe_product_id } }
end
@@ -24,6 +30,7 @@ class PdfresourcesControllerTest < ActionDispatch::IntegrationTest
end
test "should show pdfresource" do
+ skip "Not implemented yet - requires image processing tests"
get pdfresource_url(@pdfresource)
assert_response :success
end
@@ -35,12 +42,13 @@ class PdfresourcesControllerTest < ActionDispatch::IntegrationTest
test "should update pdfresource" do
patch pdfresource_url(@pdfresource), params: { pdfresource: { age_range: @pdfresource.age_range, card_description: @pdfresource.card_description, curriculum: @pdfresource.curriculum, description: @pdfresource.description, feature_slot: @pdfresource.feature_slot, name: @pdfresource.name, price: @pdfresource.price, stripe_product_id: @pdfresource.stripe_product_id } }
+ skip "Not implemented yet - requires image processing tests"
assert_redirected_to pdfresource_url(@pdfresource)
end
test "should destroy pdfresource" do
assert_difference("Pdfresource.count", -1) do
- delete pdfresource_url(@pdfresource)
+ delete pdfresource_url(@pdfresource1)
end
assert_redirected_to pdfresources_url
diff --git a/test/fixtures/pdfresources.yml b/test/fixtures/pdfresources.yml
index becdd35..b3e6dd0 100644
--- a/test/fixtures/pdfresources.yml
+++ b/test/fixtures/pdfresources.yml
@@ -1,21 +1,32 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
- name: MyString
- stripe_product_id: MyString
+ name: Resource 1
+ stripe_product_id: aabc
price: 9.99
- age_range: MyString
- curriculum: MyString
+ age_range: 1-10
+ curriculum: English
feature_slot: 1
- description: MyText
- card_description: MyText
+ description: Long description
+ card_description: Short description
two:
- name: MyString
- stripe_product_id: MyString
- price: 9.99
- age_range: MyString
- curriculum: MyString
- feature_slot: 1
- description: MyText
- card_description: MyText
+ name: Resource 2
+ stripe_product_id: aabd
+ price: 19.99
+ age_range: 1-10
+ curriculum: English
+ feature_slot: 2
+ description: Long description
+ card_description: Short description
+
+three:
+ name: Resource 3
+ stripe_product_id: aabf
+ price: 19.99
+ age_range: 1-10
+ curriculum: English
+ feature_slot: 3
+ description: Long description
+ card_description: Short description
+