RailsApps / rails-stripe-membership-saas

An example Rails 4.2 app with Stripe and the Payola gem for a membership or subscription site.

Home Page:http://railsapps.github.io/rails-stripe-membership-saas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

the rails-stripe-membership-saas application needs a set of robust tests

kathyonu opened this issue · comments

Those tests now exist. The tests now available at the links below have been developed by me over the last year or more, specifically for our in production memberships app, and adjusted for this new version of the app. The tests include 28 Visitor tests with only the it 'visitor does something' do statements, waiting for the test codes to be written. There are 124 passing tests, include an almost full suite of Stripe tests, 3 pending tests for you to finish, or .. if no one does, I will be doing so down the road a wee way.

If you want to see the tests in a standalone condition, where all you see are the tests, and the configurations setups to make the tests run, visit this respository : rails-stripe-rspec-tests :: There are two things to know about these tests, one is the Visitor Tests as described, and two is the spec/stripe/account tests .. those tests are as yet not perfected, and .. they are in the repository because any developer who is able to build the rails-stripe-membershp-saas app, even if they use the composer, they are capable of adding a very powerful addition to the memberships app with the Standalone Account capablility of Stripe. For more experienced developers who need or want it, Stripe also provides the Managed Accounts capability. Both Standalone Account, and Managed Accounts tests are there if you need and want them. If you do not want Account capability in your app, simply remove those four stripe_account*_spec.rb files. What is Account capability, you ask ? Your membership app is capable of sending money to those who sells products of any kind on your site. Example, we have coauthors on a books we publish, and we have songsters who has written songs for us .. everytime their book or song is sold on our site, they will receive their royalty as fast as we choose to send it .. from every month or more, down to one day after the funds are cleard by Stripe.com The nice thing with the Standalone Account is, Stripe does all the heavy liting, codes wise and communications and webhooks wise. Managed Accounts are far more complicated to implement, and you are responsible for all of it, every detail, every webhook.

If you would like to see these tests in a working app, arrive here : rails-stripe-membership-saas : Make sure you are always on the truenorth branch. Take a look around the /spec directory. Notice the incomplete condition of spec/shared_stripe_examples/subscription_examples.rb . I will be adjusting the file for the current membership app, or if you wish, let me know and you can take it on.

Notice I have included Pry and Simplecov gems to assist you in further developing these and any new tests. Pry is the best thing since your momma's bread. And easy !! I even left one example with the Pry binding in place .. just run $ rspec and the tests will open up for you at that point. anywhere you want to pry open your running test codes, insert this line anywhere after the IT statement, on its own line, on the hard left. With Pry, your tests are an easy open book. Any study of the easy gem named Pry is going to repay you ten thousand times in building/testings your apps.

To help anyone building the membershp app, I took it upon mysElf to open The RailsApps Gitter Room, and right now, the only folks who know of it are Daniel Kehoe, who is in attendance, and you, now reading herein. If you have any questions on the rails-stripe-membership-saas app, or the general app and stripe tests, or stripe-ruby-mock, etc., the best place to go for live answers is the RailsApps Gitter Room

If you do not know Gitter, take a moment to sign up because .. the RailsApps body of work is now answering up LIVE .. due to Daniel informing me that his work and travel schedule prevented him from opening such a live code chat room specifically tailored to the RailsApps material .. I offered to be the first one who keeps an eye out for any and all questionss. As the chat room begins to gain activity, all in attendance can become the answerer to the questioner. One thing to know about Gitter, it is forever, and it is searchable by Google and search engines. Keep this in mind when you begin to use it. Any questions on Gitter ? See the above link, sign up, and it is free, and .. I will be there to answer. One thing more .. after a week of watching five Gitter rooms, such as stripe-ruby-mock .. I am coming to see the nuances of Gitter. One is, make your window about the size of a postcard and put it on the left side of your screen, and feel free to cover all but the leftmost inch. When the little notice box shows up, you know to look. Otherwise you can ignore it. Also, there is no impatience needed on questions getting answered. If I am working, I am monitoring it. If you don't get an answer momentarily, you will later .. at the most hours later. I opened the RailsApps Gitter Room so we can actively and quickly build the best rails-stripe-membership-app possible. Please come see the view and say hello, and any questions ?? Go for it, ask away. A working RailsApps Team Member will answer you. And, if you ask about the tests .. it gives me good reason to go back into them and continue perfecting them. There are still oddities and tests of the tests codes here and there. I asked for this Pull Request so that these tests are available to you, but . I do not expect Daniel to merge this PR, as it is not quite ready for Prime Time .. the tests still have rough edges here and there and, some may be missing, some may be duplicated, and factoring will happen. As author of the tests you have my permission to copy and paste these tests into your app, or git fetch our repo file by file to get the tests you want. You can fetch and merge the truenorth branch if you like, it runs like a jet engine, with its tests in place. Make sure you fetch the truenorth branch.
Signed,
Will I Am
aka
Kathy Onu on github. this is my pen name as an author, my way to say
Thank You to all who come into contact with my works in any form
Letters count wise, KATHY ONU == THANK YOU , a Perfect Anagram

Updated Instructions : New branch with new tests : Please see PR Testsformaster #150 . I invite you to pull this branch into your working app, and take it for a spin. Please note, the Stripe tests do not address payola's actions in any way. I leave that for others to play with. The rails-stripe-membership-saas app is priceless, this is my effort to get it tested.