Skip to content

Instantly share code, notes, and snippets.

@paulspencerwilliams
Created January 25, 2015 20:06
Show Gist options
  • Save paulspencerwilliams/71c451fffe018a29cd63 to your computer and use it in GitHub Desktop.
Save paulspencerwilliams/71c451fffe018a29cd63 to your computer and use it in GitHub Desktop.
a controller spec...
require 'rails_helper'
RSpec.describe ActivitiesController do
describe "GET index" do
it "assigns @activities" do
all_activities = double("all activities")
allow(Activity).to receive(:all) { all_activities }
get :index
expect(assigns(:activities)).to eq(all_activities)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment