Skip to content

Instantly share code, notes, and snippets.

@ajsharp
Created October 27, 2009 20:37
Show Gist options
  • Save ajsharp/219935 to your computer and use it in GitHub Desktop.
Save ajsharp/219935 to your computer and use it in GitHub Desktop.
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe PatientVisitsController do
before(:each) do
stub_request_before_filters
end
describe "GET index /patients/1/patient_visits" do
before(:each) do
@patient = mock_model Patient
@patient.visits << mock_model(Visit)
Patient.should_receive(:find).and_return(@patient)
end
context "/patients/1/patient_visits/1.html" do
before(:each) do
get :index, :patient_id => @patient.id
end
it { should render_template :index }
it { should respond_with :success }
it { should render_with_layout "patients" }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment