Skip to content

Instantly share code, notes, and snippets.

@thiagoramos23
Created October 23, 2014 10:06
Show Gist options
  • Save thiagoramos23/aef70cb396dd5b2a7b7e to your computer and use it in GitHub Desktop.
Save thiagoramos23/aef70cb396dd5b2a7b7e to your computer and use it in GitHub Desktop.
New Residence Spec
require 'rails_helper'
RSpec.describe Admin::ResidencesController do
let(:user) { build_stubbed(:user) }
context "#valid_user" do
describe '#new' do
before {
sign_in user
get :new
}
it_behaves_like "renderable action", :new
it "assigns @residence to a new Residence" do
expect(assigns(:residence)).to be_a_new(Residence)
end
end
end
include_context 'redirect to sign in' do
let(:before_action) { get :new }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment