Sha256: 1840d87848d8dd54d415755425bf915cc1b5c8d47764f0346ca7b7853ace195a

Contents?: true

Size: 783 Bytes

Versions: 4

Compression:

Stored size: 783 Bytes

Contents

require "spec_helper"

describe CrowdRest do
  context "given valid app credentials" do
    it "will not get an '401 Unauthorized' response" do
      # valid params are set in spec_helper
      response = CrowdRest.get("/search")
      response.code.should_not == 401
    end
  end

  context "given invalid app credentials" do
    before(:all) do
      @old_app_name = CrowdRest.app_name
      @old_app_pass = CrowdRest.app_pass
      CrowdRest.app_name = "badname"
      CrowdRest.app_pass = "badpass"
    end
    
    after(:all) do
      CrowdRest.app_name = @old_app_name
      CrowdRest.app_pass = @old_app_pass
    end
    
    it "will get an '401 Unauthorized' response" do
      response = CrowdRest.get("/search")
      response.code.should == 401      
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
crowd_rest-0.1.1 spec/crowd_rest_spec.rb
crowd_rest-0.1.0 spec/crowd_rest_spec.rb
crowd_rest-0.0.2 spec/crowd_rest_spec.rb
crowd_rest-0.0.1 spec/crowd_rest_spec.rb