asciinema.org/spec/support/feature_helpers.rb

35 lines
889 B
Ruby
Raw Normal View History

module Asciinema
2013-05-27 19:25:29 +00:00
module FeatureHelpers
def expect_browse_links
2013-05-27 19:25:29 +00:00
expect(page).to have_link('All')
expect(page).to have_link('Popular')
end
2013-05-27 20:03:16 +00:00
def expect_doc_links
expect(page).to have_link('About')
expect(page).to have_link('Getting started')
expect(page).to have_link('Recorder options')
end
2013-05-27 21:44:12 +00:00
def set_omniauth(provider, opts = {})
if opts[:message]
OmniAuth.config.mock_auth[provider] = opts[:message]
else
OmniAuth.config.mock_auth[provider] = OmniAuth::AuthHash.new({
:provider => provider.to_s,
:uid => '123456',
:info => { :nickname => opts[:nickname] },
:extra => {
:raw_info => {
2013-05-30 10:03:08 +00:00
:avatar_url =>
'http://gravatar.com/avatar/9cecfc695240b56e5d3c1a5dc3830967'
2013-05-27 21:44:12 +00:00
}
}
})
end
end
2013-05-27 19:25:29 +00:00
end
end