Sha256: a153a5002f3edf5f41af24a3e9a1908d12abae870d2eff1e34c3069d8b59af4e
Contents?: true
Size: 1.91 KB
Versions: 58
Compression:
Stored size: 1.91 KB
Contents
require 'spec_helper' RSpec.describe Bookends::ApplicationHelper, type: :helper do describe 'signup_link' do it 'sets the :class option as the value for the class HTML attribute' do html = '<a class="btn btn-lg" data-trackable="{"category":"Sign Up Links","action":"Clicked","label":"github-students"}" href="https://signup.heroku.com">Sign up!</a>' expect(helper.signup_link('Sign up!', ga_label: 'github-students', class: 'btn btn-lg')).to eq(html) end it 'sets the :ga_label option in the data-trackable HTML attribute' do html = '<a data-trackable="{"category":"Sign Up Links","action":"Clicked","label":"github-students"}" href="https://signup.heroku.com">Sign up!</a>' expect(helper.signup_link('Sign up!', ga_label: 'github-students')).to eq(html) end it 'appends the :signup_path option in the generated URL' do html = '<a data-trackable="{"category":"Sign Up Links","action":"Clicked","label":"github-students"}" href="https://signup.heroku.com/github-students">Sign up!</a>' expect(helper.signup_link('Sign up!', ga_label: 'github-students', signup_path: 'github-students')).to eq(html) end it 'sets the :redirect_url argument as a redirect-url param in the resulting URL' do html = '<a class="btn btn-lg" data-trackable="{"category":"Sign Up Links","action":"Clicked","label":"github-students"}" href="https://signup.heroku.com/github-students?redirect-url=https%3A%2F%2Fwww.heroku.com%2Fgithub-students">Sign up!</a>' expect(helper.signup_link('Sign up!', ga_label: 'github-students', redirect_url: 'https://www.heroku.com/github-students', signup_path: 'github-students', class: 'btn btn-lg')).to eq html end end end
Version data entries
58 entries across 58 versions & 1 rubygems