asciinema.org/spec/lib/ouath_helper_spec.rb
Marcin Kulik 8cbfe6844b Fix typo
2012-03-02 22:36:26 +01:00

45 lines
883 B
Ruby

require 'spec_helper'
describe OauthHelper do
describe ".avatar_url" do
let(:avatar_url) { "http://foo.bar/foo.png" }
context "when github auth" do
let(:auth) do
{
"provider" => "github",
"extra" => {
"raw_info" => {
"avatar_url" => avatar_url
}
}
}
end
it { OauthHelper.get_avatar_url(auth).should == avatar_url}
end
context "when twitter auth" do
let(:auth) do
{
"provider" => "twitter",
"info" => {
"image" => avatar_url
}
}
end
it { OauthHelper.get_avatar_url(auth).should == avatar_url}
end
context "when other provider" do
let(:auth) do
{ "provider" => "other" }
end
it { OauthHelper.get_avatar_url(auth).should be_nil }
end
end
end