diff --git a/app/controllers/api/v1/user_controller.rb b/app/controllers/api/v1/user_controller.rb deleted file mode 100644 index 559f967..0000000 --- a/app/controllers/api/v1/user_controller.rb +++ /dev/null @@ -1,18 +0,0 @@ -class Api::V1::UserController < ApplicationController - def login - @user = User.find_by(name: user_params[:name]) - if @user - render json: { - status: { code: 200, message: 'signed in successfuly', data: @user } - }, status: :ok - else - render json: { error: 'User not found' }, status: :not_found - end - end - - private - - def user_params - params.require(:user).permit(:name) - end -end diff --git a/config/routes.rb b/config/routes.rb index 262ffd5..1daf9a4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,2 @@ Rails.application.routes.draw do - # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html - - # Defines the root path route ("/") - # root "articles#index" end diff --git a/spec/requests/v1/users_spec.rb b/spec/requests/v1/users_spec.rb new file mode 100644 index 0000000..a4271f0 --- /dev/null +++ b/spec/requests/v1/users_spec.rb @@ -0,0 +1,7 @@ +require 'rails_helper' + +RSpec.describe "V1::Users", type: :request do + describe "GET /index" do + pending "add some examples (or delete) #{__FILE__}" + end +end