RailsApps / rails-stripe-membership-saas

An example Rails 4.2 app with Stripe and the Payola gem for a membership or subscription site.
http://railsapps.github.io/rails-stripe-membership-saas
1.14k stars 232 forks source link

20150502stripecardapi #135

Closed kathyonu closed 9 years ago

kathyonu commented 9 years ago

20150509 : PLEASE QUASH THIS PULL REQUEST. I now see it is riddled with errors. Thank You.

stripe_card_spec.rb tests passing the Gemfile changes are best viewed here : https://github.com/RailsApps/rails-stripe-membership-saas/blob/6dc22f99fc0031f727315d3104f1ebda2722703c/Gemfile

tmock12 commented 9 years ago

Hey @kathyonu. I appreciate all the work that you've put in. That took some real time!

However it looks like the stripe_card_spec.rb mainly tests the Payola gem and not necessarily the actions surrounding our app. Payola already has a pretty adequate test suite so theres no reason for us to duplicate that.

I know Daniel would love to have tests around this app (as would I) and I think a great place to start would be adding some generic integration specs. Something like:

Given I am on the home page
And I click Subscribe to Silver
And i fill in all fields correctly
And I press submit
Then I should be signed in succesfully

Once we have some overarching integration specs we can start drilling into some of the bugs people are reporting and expose the bugs through unit tests while feeling fairly confident we haven't shut down core features of the system.

You may already know this, but just in case: to prevent things like letting 'pry' slip in there in the future, try using git add -p. This brings up an interactive prompt in the terminal where you can choose to add the file to your commit using things like (y)es, (n)o, (e), etc. Its really handy when you have a lot of files and need to commit them incrementally.

Again, thanks for all the help and passion you bring to the project. We really appreciate it! And if you could write some generic integration specs that would be a HUGE help! And please don't hesitate to reach out for help or with any questions.

kathyonu commented 9 years ago

Hay Stack, there @tmock12 ,

Such beautifully expressive letters formed into words formed into sentences forming ideas shared … stunningly so.

Thank You, Sir .. kind words count towards Peace On Earth Good Will All. (That’s a plug for our works at our non-profit, for which all this work with RailsApps is akin.)

Your tests are coming right up, including specifically the one you outline .. You hit the very heart of the matter with that one, Eye tell Yee. Whoo wee Bob, that sole test has absorbed my attention for months on end. Yesterday I made a, to me, large breakthrough in seeing another ‘missingness’ in the testing of those steps .. And .. I believe I am another 15 minutes away from a fully passing test of the /users/sign_up/?plan=“anything_you_name_your_plan" I feel certain I have found the final RSpec Capybara Javascript's jQuery element location and manipulation command of the Silver select button. and Gold and Platinum and any plan you want to add down the road. My goal is before 201505050005pst, the codes testing the membership app Visitors and Users, will be on my fork, ready to view and play with if you like. I will be issuing a PR on just those two .. stripe tests will follow, and thank you for your suggestion. I also just noticed today, I have duplicates of Stripe tests .. those dups will be disappearing before I push them.

We currently stand at 82 tests, 1 failure, 2 pending. That failure is the /uers/sign_up and it will be passing later this evening, I feel certain.

At that point, I will push just the Visitor and User test codes to our fork in a new branch, and .. Issue the pull request to Daniel.

It’s a good day. with this User test now close to passing .. as a programmer, you know .. Only those who live in the same abode can understand what it takes to pull this off. Well, I speak for me only .. it is an enormous investment in study time and typing time.

The real Hobo Hero here, though .. is @danielkehoe , his tutorials are beyond the normal ken .. crazy-deep, as one person commented. Eye mysElf could have never built the membershpis app to the point he has. Me finding Daniel’s works .. it qualifies as a Godsend in my book. The learnings with RailsApps never stops and it consistently get better, and cleaner and clearer, and more productive, and tested.

While we have the shining eyes of @danielkehoe .. my plan now is the above by this evening, then .. I am going full bore on bringing into one new branch, all the stripe tests on card, customer, charge, etc. The goal for that branch will be 100% test coverage, all tests passing. From that branch, I will pull out the working sections, one by one, and send each working part as a whole unto itself.
Nothing extra, nothing missing. Each a package of functionality unto itself.

Then .. I am going to tackle the webhooks, the single most powerful aspect of our membership site, bar none. If anyone wants to write the suites of tests and codes for the suites of webhooks re Stripe / Payola .. and ?? Go for it.

I also intend to be writing in the Bitcoin tests and code additions .. So, if anyone wants to do those tests and codes and PR's .. go for it.

Breathe and Be Well, @tmock12 , @danielkehoe

and …

Thank You, again, T We be doin it.

Will I Are Workin It :: $ git add -p i saw that the other day, and didn’t undestand it and so didn’t use it. thanks for point it out, T

One more thing: on the Stripe tests .. an example being the use of StripeCard.retrieve(), StripeCustomer.retrieve() We are testing our ability to contact Stripe, retrieve a customer, card, charge, etc. And as for mysElf, I could not figure out how to test the users/sign_up … without using and testing Stripe, and their responses. i guess i could have stub’ed/verified_double’d/mock’ed my way through it .. i think the way i have written the tests on this matter, tests the real workings of the matter of signing up.

On May 4, 2015, at 6:01 PM, Taylor Mock notifications@github.com wrote:

Hey @kathyonu https://github.com/kathyonu. I appreciate all the work that you've put in. That took some real time!

However it looks like the stripe_card_spec.rb mainly tests the Payola gem and not necessarily the actions surrounding our app. Payola already has a pretty adequate test suite so theres no reason for us to duplicate that.

I know Daniel would love to have tests around this app (as would I) and I think a great place to start would be adding some generic integration specs. Something like:

Given I am on the home page And I click Subscribe to Silver And i fill in all fields correctly And I press submit Then I should be signed in succesfully Once we have some overarching integration specs we can start drilling into some of the bugs people are reporting and expose the bugs through unit tests while feeling fairly confident we haven't shut down core features of the system.

You may already know this, but just in case: to prevent things like letting 'pry' slip in there in the future, try using git add -p. This brings up an interactive prompt in the terminal where you can choose to add the file to your commit using things like (y)es, (n)o, (e), etc. Its really handy when you have a lot of files and need to commit them incrementally.

Again, thanks for all the help and passion you bring to the project. We really appreciate it! And if you could write some generic integration specs that would be a HUGE help! And please don't hesitate to reach out for help or with any questions.

— Reply to this email directly or view it on GitHub https://github.com/RailsApps/rails-stripe-membership-saas/pull/135#issuecomment-98896088.

tmock12 commented 9 years ago

Closing pull request per comment from @kathyonu

"20150509 : PLEASE QUASH THIS PULL REQUEST. I now see it is riddled with errors. Thank You."

kathyonu commented 9 years ago

Greetings @tmock12 ,

I am hoping to have the first suite of tests ready to push as a branch for PR review, the evening of 20150514. I say suite because . . it is the smallest unit of testings that makes sense as a first set to build upon. It will cover the Visitor actions, and the User Sign up, Sign in, Sign out, and Edit account, I think. Not sure on the Edit account, that may come a bit later.
The Sign up test has been the bugaboo here. Every time I think I have the last line of code in place .. It began to feel like the Dichotomy Paradox, https://en.wikipedia.org/wiki/Zeno%27s_paradoxes where you keep arriving half-way to your destination and so can never arrive.

I have given great thought to your comments on Payola/Stripe tests .. and will be adjusting those tests accordingly .. right after I am done with the Sign up stuff.

Thank You for closing my prior PR’s. I think you will like the code that is soon arriving.

On May 4, 2015, at 6:01 PM, Taylor Mock notifications@github.com wrote:

Hey @kathyonu https://github.com/kathyonu. I appreciate all the work that you've put in. That took some real time!

However it looks like the stripe_card_spec.rb mainly tests the Payola gem and not necessarily the actions surrounding our app. Payola already has a pretty adequate test suite so theres no reason for us to duplicate that.

I know Daniel would love to have tests around this app (as would I) and I think a great place to start would be adding some generic integration specs. Something like:

Given I am on the home page And I click Subscribe to Silver And i fill in all fields correctly And I press submit Then I should be signed in succesfully Once we have some overarching integration specs we can start drilling into some of the bugs people are reporting and expose the bugs through unit tests while feeling fairly confident we haven't shut down core features of the system.

You may already know this, but just in case: to prevent things like letting 'pry' slip in there in the future, try using git add -p. This brings up an interactive prompt in the terminal where you can choose to add the file to your commit using things like (y)es, (n)o, (e), etc. Its really handy when you have a lot of files and need to commit them incrementally.

Again, thanks for all the help and passion you bring to the project. We really appreciate it! And if you could write some generic integration specs that would be a HUGE help! And please don't hesitate to reach out for help or with any questions.

— Reply to this email directly or view it on GitHub https://github.com/RailsApps/rails-stripe-membership-saas/pull/135#issuecomment-98896088.