Skip to content

Instantly share code, notes, and snippets.

@adammiribyan
Created October 8, 2012 01:05
Show Gist options
  • Save adammiribyan/3850210 to your computer and use it in GitHub Desktop.
Save adammiribyan/3850210 to your computer and use it in GitHub Desktop.
Controller spec refactoring
context "#start_phone_call", :focus do
before :each do
@harry = FactoryGirl.create(:client, first_name: "Harry", stripe_customer_token: nil)
@arnold = FactoryGirl.create(:lawyer, first_name: "Arnold")
controller.stubs(:current_user).returns(@harry)
end
it "should redirect to payment info page unless client has already has it saved" do
get :start_phone_call, { id: @arnold.to_param, client_number: "6087004680" }
request.should redirect_to call_payment_path(@arnold.to_param)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment