We've moved discussions to Discord

Plans test fails (switching accounts doesn't seem to work)

Matthias Orgler
With a fresh install of JSP and my Stripe connected in development, I ran bin/rake to find one test failing:

Failure:
Jumpstart::PlansTest#test_can_view_subscribe_page_for_a_account_plan [/Users/morgler/code/setlists/test/integration/plans_test.rb:55]:
Expected false to be truthy.

It's only the line that tests whether the account name is shown on the checkout form (everything else works if I comment out that assert). I checked the credentials for test and was surprised to find existing test keys there – is that correct? I tried bin/rake with these stock keys and also with my own keys (from the Stripe test environment), but neither made the test pass.

Am I missing something?
Matthias Orgler
I had the same test failing on a new install of JSP. I doubt it has anything to do with Stripe though. First investigation showed that the switch_account test helper doesn't seem to actually switch the account (the name on the account page is still that of the personal account)! My app is using personal and team accounts and lets them be switched via subdomains (I turned off subdomain switching, but it made no difference).

(BTW: That test first failed with an UnsafeRedirect error with subdomain switching turned on, so I had to add "allow_other_host: true" to the subdomain redirect in the AccountsController. Now it works in development, but it causes the above mentioned test to fail, because the switching doesn't work during tests.)
Matthias Orgler
I can make the test pass, if I add script_name to the path helper.

So it seems this test is not working with account switching turned on either via subdomains or paths. Is there a way to make all tests work WITHOUT having to add script_name to every single integration test?
Matthias Orgler
This issue seems to be related to https://jumpstartrails.com/discussions/324
Notifications
You’re not receiving notifications from this thread.