diff --git a/app/controllers/api/v1/users_controller.rb b/app/controllers/api/v1/users_controller.rb new file mode 100644 index 0000000..2afc41e --- /dev/null +++ b/app/controllers/api/v1/users_controller.rb @@ -0,0 +1,11 @@ +class Api::V1::UsersController < ApplicationController + + skip_before_filter :authenticated + + respond_to :json + + def index + respond_with ({:hi => :world}) + end + +end diff --git a/app/helpers/api/v1/users_helper.rb b/app/helpers/api/v1/users_helper.rb new file mode 100644 index 0000000..4d5288c --- /dev/null +++ b/app/helpers/api/v1/users_helper.rb @@ -0,0 +1,2 @@ +module Api::V1::UsersHelper +end diff --git a/config/routes.rb b/config/routes.rb index 9c21e1a..2383276 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -33,7 +33,7 @@ Railsgoat::Application.routes.draw do resources :messages do end - + end get "download" => "benefit_forms#download" @@ -81,6 +81,12 @@ Railsgoat::Application.routes.draw do get "home" end end + + namespace :api, defaults: {format: 'json'} do + namespace :v1 do + resources :users + end + end root :to => "sessions#new" diff --git a/spec/controllers/api/v1/users_controller_spec.rb b/spec/controllers/api/v1/users_controller_spec.rb new file mode 100644 index 0000000..184b048 --- /dev/null +++ b/spec/controllers/api/v1/users_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe Api::V1::UsersController do + +end diff --git a/spec/helpers/api/v1/users_helper_spec.rb b/spec/helpers/api/v1/users_helper_spec.rb new file mode 100644 index 0000000..13a6067 --- /dev/null +++ b/spec/helpers/api/v1/users_helper_spec.rb @@ -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