Skip to content

Instantly share code, notes, and snippets.

@remi
Last active December 14, 2015 03:19
Show Gist options
  • Select an option

  • Save remi/5019778 to your computer and use it in GitHub Desktop.

Select an option

Save remi/5019778 to your computer and use it in GitHub Desktop.

Revisions

  1. remi revised this gist Feb 23, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions reports_controller_spec.rb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    describe ReportsController do
    subject { last_response }

    describe :create do
    let(:payload) { { :serial => serial, :version => "1.0.0" } }
    before { post reports_path, payload.to_json }
  2. remi revised this gist Feb 23, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion reports_controller_spec.rb
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    describe ReportsController do
    describe :create do
    let(:payload) { { :serial => serial, :version => "1.0.0" } }
    before { post "/reports", payload.to_json }
    before { post reports_path, payload.to_json }

    context "with present serial" do
    let(:serial) { "123abc" }
  3. remi revised this gist Feb 23, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions reports_controller_spec.rb
    Original file line number Diff line number Diff line change
    @@ -7,14 +7,14 @@
    let(:serial) { "123abc" }

    it { should be_ok }
    its(:status) { should eq 200 }
    its(:status) { should eq 200 }
    end

    context "with missing serial" do
    let(:serial) { nil }

    it { should_not be_ok }
    its(:status) { should eq 400 }
    its(:status) { should eq 400 }
    end
    end
    end
  4. remi created this gist Feb 23, 2013.
    20 changes: 20 additions & 0 deletions reports_controller_spec.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    describe ReportsController do
    describe :create do
    let(:payload) { { :serial => serial, :version => "1.0.0" } }
    before { post "/reports", 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