okay first run at making an API for railsgoat
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
class Api::V1::UsersController < ApplicationController
|
||||||
|
|
||||||
|
skip_before_filter :authenticated
|
||||||
|
|
||||||
|
respond_to :json
|
||||||
|
|
||||||
|
def index
|
||||||
|
respond_with ({:hi => :world})
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
module Api::V1::UsersHelper
|
||||||
|
end
|
||||||
+7
-1
@@ -33,7 +33,7 @@ Railsgoat::Application.routes.draw do
|
|||||||
|
|
||||||
resources :messages do
|
resources :messages do
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
get "download" => "benefit_forms#download"
|
get "download" => "benefit_forms#download"
|
||||||
@@ -81,6 +81,12 @@ Railsgoat::Application.routes.draw do
|
|||||||
get "home"
|
get "home"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
namespace :api, defaults: {format: 'json'} do
|
||||||
|
namespace :v1 do
|
||||||
|
resources :users
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
root :to => "sessions#new"
|
root :to => "sessions#new"
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Api::V1::UsersController do
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
# Specs in this file have access to a helper object that includes
|
||||||
|
# the Api::V1::UsersHelper. For example:
|
||||||
|
#
|
||||||
|
# describe Api::V1::UsersHelper do
|
||||||
|
# describe "string concat" do
|
||||||
|
# it "concats two strings with spaces" do
|
||||||
|
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
describe Api::V1::UsersHelper do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user