spec/omniauth/strategies/salesforce_spec.rb in omniauth-salesforce-1.0.4 vs spec/omniauth/strategies/salesforce_spec.rb in omniauth-salesforce-1.0.5

- old
+ new

@@ -15,13 +15,13 @@ 'rack.session' => {}, 'HTTP_USER_AGENT' => 'unknown', 'REQUEST_METHOD' => 'GET', 'rack.input' => '', 'rack.url_scheme' => 'http', - 'SERVER_NAME' => 'server.example', - 'QUERY_STRING' => 'code=xxxx', - 'SCRIPT_NAME' => '', + 'SERVER_NAME' => 'server.example', + 'QUERY_STRING' => 'code=xxxx', + 'SCRIPT_NAME' => '', 'SERVER_PORT' => 80 } end context "when using a mobile browser" do user_agents = { @@ -105,11 +105,11 @@ describe "info" do subject { strategy.info } it "returns an info hash" do subject.should_not be_nil end - it "sets name" do + it "sets name" do subject['name'].should == raw_info['display_name'] end it "sets email" do subject['email'].should == raw_info['email'] end @@ -138,11 +138,11 @@ subject['urls'].should == raw_info['urls'] end end describe "credentials" do subject { strategy.credentials } - it "sets token" do + it "sets token" do subject['token'].should == strategy.access_token.token end it "sets instance_url" do subject['instance_url'].should == strategy.access_token.params["instance_url"] end @@ -178,10 +178,10 @@ signature = nil instance_url = 'http://instance.salesforce.example' before do client_id = "https://login.salesforce.com/id/00Dd0000000d45TEBQ/005d0000000fyGPCCY" issued_at = "1331142541514" - signature = Base64.strict_encode64(OpenSSL::HMAC.digest('sha256', strategy.options.client_secret, client_id + issued_at)) + signature = Base64.strict_encode64(OpenSSL::HMAC.digest('sha256', strategy.options.client_secret.to_s, client_id + issued_at)) end context "when the signature does not match" do before do access_token = OAuth2::AccessToken.from_hash strategy.access_token.client, { 'id' => 'forged client id',