Skip to content

Instantly share code, notes, and snippets.

@richievos
Created November 19, 2011 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save richievos/1378807 to your computer and use it in GitHub Desktop.
Save richievos/1378807 to your computer and use it in GitHub Desktop.
Spectastrophe #1
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe "Something doppelganger" do
describe "RailCar" do
let(:gateway) { RailCar.new :login => "a", :password => "b" }
describe "#commit" do
let(:response) { railcar.send :commit, request, {} }
describe "response" do
subject { response }
context "with a REJECTed rail car" do
let(:request) { gateway.send(:build_auth_request, 9011, "token", {}) }
before {
railcar.stub(:parse).and_return(
:requestID => "123",
:vehicleCodeRaw => "N9",
:requestToken => "AFLAKJFLDKJFSLDKFJSLDFKJn129399NANF)(A)FNnnnfnfnnfnf",
:amount => "90.01",
)
}
its(:name) { should_not be_nil }
end
end
end
end
end
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe "Something doppelganger" do
it "has an name for a REJECTed rail car" do
railcar = RailCar.new :login => "a", :password => "b"
railcar.stub(:parse).and_return(
:requestID => "123",
:vehicleCodeRaw => "N9",
:requestToken => "AFLAKJFLDKJFSLDKFJSLDFKJn129399NANF)(A)FNnnnfnfnnfnf",
:amount => "90.01",
)
request = railcar.send(:build_request, 9011, "token", {})
response = railcar.send(:commit, request, {})
response.name.should_not be_nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment