It is very easy to use this library. Just use the get_redirection_url method
def help_desk_url
options = {
username: user_name,
email: email,
role: role
}
SsoService.init(options).get_redirection_url| # Author : Shiva Bhusal | |
| # github: shivabhusal | |
| # stackoverflow: users/3437900/illusionist | |
| ########################################## | |
| # Usages: | |
| # - create a file called ~/.promptrc | |
| # - add following in ~/.bashrc | |
| # `source ~/.promptrc` | |
| # # this will include the source of the file |
| # /email/base.rb | |
| class Email::Base | |
| # This class is mostly responsible for Sending email via SendGrid or Other Provier in future | |
| # Code in here are Common to all its successors | |
| RootURL = 'http://dashboard.thepact.com' | |
| VarPrefix = '{{' | |
| VarSuffix = '}}' | |
| attr_reader :client, :from, :template, :subject, :recipients |
Newbie developers might wonder how they can test if their routes are in good conditions. They might not find good examples so I have pasted some examples from my code.
require 'rails_helper' describe 'Routes Spec', type: :routing do describe 'Admin Section' do describe 'Articles Controller' do it "should route 'admin/articles/category', :to => 'articles#add_category'" do expect(post: 'admin/articles/category').to route_to('admin/articles#add_category') end
| class SignUpHandler | |
| def process | |
| stripe_token = get_stripe_card_token | |
| token = stripe_token.id | |
| puts "Stripe Token Generated for card #{'*'*12}#{stripe_token.card.last4}" | |
| response = get_sign_up_form |
| require 'sshkit' | |
| require 'sshkit/dsl' | |
| on ['[email protected]'] do | |
| # upload! '/home/john/Downloads/__thepact_com/__thepact_com.crt', '/home/deployer/__thepact_com.crt' | |
| # upload! '/home/john/Downloads/__thepact_com/__thepact_com.p7b', '/home/deployer/__thepact_com.p7b' | |
| upload! '/home/john/Downloads/__thepact_com/__thepact_com.ca-bundle', '/home/deployer/__thepact_com.ca-bundle' | |
| within '/home/deployer/' do |
| # spec/support/wait_for_ajax.rb | |
| # There is inbuild `wait_for_ajax` method in selinium WebDriver library | |
| # This is for Capybara Webkit only | |
| # # | |
| module WaitForAjax | |
| def wait_for_ajax | |
| Timeout.timeout(Capybara.default_max_wait_time) do | |
| loop until finished_all_ajax_requests? | |
| end | |
| end |
| # spec/support/wait_for_ajax.rb | |
| # There is inbuild `wait_for_ajax` method in selinium WebDriver library | |
| # This is for Capybara Webkit only | |
| # # | |
| module WaitForAjax | |
| def wait_for_ajax(timeout = Capybara.default_wait_time) | |
| Timeout.timeout(timeout) do | |
| active = page.evaluate_script('jQuery.active') | |
| until active == 0 | |
| active = page.evaluate_script('jQuery.active') |
| Sample Order | |
| <Spree::Order:0x007fa6d37b52d8 | |
| id: 6, | |
| number: "R141192317", | |
| item_total: #<BigDecimal:7fa6d3d37d28,'0.1999E2',18(27)>, | |
| total: #<BigDecimal:7fa6d39816c0,'0.2599E2',18(27)>, | |
| state: "complete", | |
| adjustment_total: #<BigDecimal:7fa6d3d37b48,'0.1E1',9(18)>, | |
| user_id: 4, | |
| completed_at: Thu, 10 Mar 2016 03:24:55 UTC +00:00, |
| GIT | |
| remote: git://github.com/spree-contrib/spree_mail_settings.git | |
| revision: d416a1e355893bda625ed5bea187d39526aa52f9 | |
| branch: 3-0-stable | |
| specs: | |
| spree_mail_settings (3.0.0) | |
| spree_backend (~> 3.0.0) | |
| GIT | |
| remote: git://github.com/spree/spree_auth_devise.git |