Skip to content

Instantly share code, notes, and snippets.

@alexanmtz
Forked from psobocinski/dummy_controller.rb
Created September 26, 2020 00:20
Show Gist options
  • Save alexanmtz/5be53b40231efc5472183d5c2abb5456 to your computer and use it in GitHub Desktop.
Save alexanmtz/5be53b40231efc5472183d5c2abb5456 to your computer and use it in GitHub Desktop.

Revisions

  1. @psobocinski psobocinski created this gist Jan 23, 2016.
    5 changes: 5 additions & 0 deletions dummy_controller.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    class DummyController < ApplicationController
    def do
    render json: { balance: 50 }
    end
    end
    11 changes: 11 additions & 0 deletions dummy_controller_test.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    require 'test_helper'

    class DummyControllerTest < ActionController::TestCase
    test "should get do" do

    get :do

    json_response = JSON.parse(response.body)
    assert_equal 50, json_response["balance"]
    end
    end