-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Api for sports list for a particular city #20
base: development
Are you sure you want to change the base?
Conversation
render json: {"error": I18n.t(city_sports.id_not_found)}, status: 422 if city_sports.nil? | ||
city_sports.find_each do |citysport| | ||
sport_list += Sport.where(id: citysport.sport_id) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MayurDeshmukh10 Remove this loop
city_sports.find_each do |citysport| | ||
sport_list += Sport.where(id: citysport.sport_id) | ||
end | ||
render json: {"error": I18n.t(city_sports.sport_list_empty)}, status: 422 if sport_list.empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MayurDeshmukh10 Sports List Empty does not necesaarily mean there is some error right?
@@ -3,6 +3,8 @@ | |||
Rails.application.routes.draw do | |||
namespace :api do | |||
namespace :v1 do | |||
get "/city_sports/display", to: "city_sports#displaysports" | |||
resources :city_sports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MayurDeshmukh10 Why "resources :city_sports"?
end | ||
|
||
it "returns a unauthorized status due to jwt invalidation" do | ||
@token3 = "eyJhbGciOiJIUzI1NiIsInR5cuKokeLSu9F62ck-CX2XvrquAsTNc9_agkPcYzk" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MayurDeshmukh10 Dont pass the hard coded token. Generate it. You can write a method and call it everywhere in your test cases
No description provided.