Skip to content
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

Open
wants to merge 25 commits into
base: development
Choose a base branch
from

Conversation

MayurDeshmukh10
Copy link
Collaborator

No description provided.

@MayurDeshmukh10
Copy link
Collaborator Author

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

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?

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

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"

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants