Sha256: fd27cedf372c309e4eb36fea015589d3366396b869099ce1595d8350abc72dd2

Contents?: true

Size: 1.51 KB

Versions: 105

Compression:

Stored size: 1.51 KB

Contents

require 'faker'
require 'httparty'

class Helper 
    include HTTParty

    def getTitle() 
        return Faker::Movie.title
    end
    def getSampleUser()
        user = {
            'name'=> Faker::Name.name,
            'password' => '1234567890',
            'confirmPassword' => '1234567890',
            'email' => Faker::Internet.email,
            'companyName' => Faker::Company.name,
            'jobTitle' => Faker::Company.profession,
            'companySize' => Faker::Number.between(from: 1, to: 100),
            'card' => {
                'stripeToken' => 'tok_visa'
            },
            'subscription' => {
                'stripePlanId' => 0
            },
            'cardName' => Faker::Stripe.valid_token,
            'cardNumber' => Faker::Stripe.valid_card,
            'expiry' => Faker::Stripe.valid_card,
            'cvv' => 123,
            'city' => Faker::Address.city,
            'state' => Faker::Address.state,
            'zipCode' => Faker::Address.zip_code,
            'planId' => 'plan_GoWIYiX2L8hwzx',
            'companyRole' => Faker::Company.profession,
            'companyPhoneNumber' => Faker::Company.profession,
            'reference' => 'Github',
        } 
        return user
    end

    def makeApiRequest(url, data, token = nil)
        # make api request and return response 
        params = { body: data, headers: token == nil ? nil : {Authorization: 'Basic '+token}}


        response = self.class.post(url, params).parsed_response
        return response
    
    end
end 

Version data entries

105 entries across 105 versions & 1 rubygems

Version Path
fyipe-3.0.14476.pre.qa spec/helper.rb
fyipe-3.0.14419.pre.qa spec/helper.rb
fyipe-3.0.14400.pre.qa spec/helper.rb
fyipe-3.0.14394.pre.qa spec/helper.rb
fyipe-3.0.14342.pre.qa spec/helper.rb
fyipe-3.0.14281.pre.qa spec/helper.rb
fyipe-3.0.14267.pre.qa spec/helper.rb
fyipe-3.0.14235.pre.qa spec/helper.rb
fyipe-3.0.14233.pre.qa spec/helper.rb
fyipe-3.0.14202.pre.qa spec/helper.rb
fyipe-3.0.14151.pre.qa spec/helper.rb
fyipe-3.0.14140.pre.qa spec/helper.rb
fyipe-3.0.14114.pre.qa spec/helper.rb
fyipe-3.0.14104.pre.qa spec/helper.rb
fyipe-3.0.14102.pre.qa spec/helper.rb
fyipe-3.0.14100.pre.qa spec/helper.rb
fyipe-3.0.14089.pre.qa spec/helper.rb
fyipe-3.0.14087.pre.qa spec/helper.rb
fyipe-3.0.14054.pre.qa spec/helper.rb
fyipe-3.0.14051.pre.qa spec/helper.rb