Sha256: 63809de1bc102368370f226311768efaf63fe176ff58e6d7ea61ea3dc3246b77

Contents?: true

Size: 1.92 KB

Versions: 6

Compression:

Stored size: 1.92 KB

Contents

require_relative './spec_helper'

describe "Signature" do
  describe "signature" do
    context "when user is unauthenticated" do
      it_behaves_like "Unauthenticated", -> (api) { api.signature }
    end

    context "with no :sucess_action_redirect" do
      it "should be successful" do
        api = _api(login: user1["login"],
                   application_token: user1["rw_token"])

        expect(api.signature.http_status_code).to eq(200)
      end
    end

    context "with unencoded :success_action_redirect" do
      it "should be successful" do
        api = _api(login: user1["login"],
                   application_token: user1["rw_token"])
        expect(
          api.signature(
            :success_action_redirect => "http://test.com"
          ).http_status_code
        ).to eq(200)
      end
    end

    context "with URI encoded :success_action_redirect" do
      it "should be successful" do
        api = _api(login: user1["login"],
                   application_token: user1["rw_token"])
        expect(
          api.signature(
            :success_action_redirect => CGI.escape("http://test.com")
          ).http_status_code
        ).to eq(200)
      end
    end

    context "encoded :success_action_redirect with qs parameters" do
      it "should be successful" do
        api = _api(login: user1["login"],
                   application_token: user1["rw_token"])
        expect(
          api.signature(
            :success_action_redirect => CGI.escape("http://test.com?x=y")
          ).http_status_code
        ).to eq(200)
      end
    end

    context "with a :success_action_redirect with qs parameters" do
      it "should be successful" do
        api = _api(login: user1["login"],
                   application_token: user1["rw_token"])
        expect(
          api.signature(
            :success_action_redirect => "http://test.com?x"
          ).http_status_code
        ).to eq(200)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vzaar-1.5.2 examples/signature_spec.rb
vzaar-1.5.1 examples/signature_spec.rb
vzaar-1.5.0 examples/signature_spec.rb
vzaar-1.4.4 examples/signature_spec.rb
vzaar-1.4.1 examples/signature_spec.rb
vzaar-1.3.1 examples/signature_spec.rb