Guest User

Untitled

a guest
May 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.55 KB | None | 0 0
  1. DEFAULT_MIME_RESPONDS_COLLECTION = (1..10).map{ |i| OpenStruct.new("id" => i, "name" => "name_#{i}")}
  2.  
  3. class DefaultMimeRespondsControllerTest < ActionController::TestCase
  4.   test "should respond default js response" do
  5.     get :index, :format => 'js'
  6.     assert_equal JSON.parse(@response.body), JSON.parse(DEFAULT_MIME_RESPONDS_COLLECTION.to_json)
  7.   end
  8. end
  9.  
  10. class DefaultMimeRespondsController < UbiquoController
  11.   def index
  12.     @default_mime_responds = DEFAULT_MIME_RESPONDS_COLLECTION
  13.     respond_to do |format|
  14.       format.html
  15.     end
  16.   end
  17. end
Add Comment
Please, Sign In to add comment