Skip to content

Instantly share code, notes, and snippets.

@remi
Last active December 14, 2015 03:19
Show Gist options
  • Save remi/5019778 to your computer and use it in GitHub Desktop.
Save remi/5019778 to your computer and use it in GitHub Desktop.
let, let, let, let, let, let, let.
describe ReportsController do
subject { last_response }
describe :create do
let(:payload) { { :serial => serial, :version => "1.0.0" } }
before { post reports_path, payload.to_json }
context "with present serial" do
let(:serial) { "123abc" }
it { should be_ok }
its(:status) { should eq 200 }
end
context "with missing serial" do
let(:serial) { nil }
it { should_not be_ok }
its(:status) { should eq 400 }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment