Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions app/presenters/user_list_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ def initialize(params)
@type = (params.keys.map(&:to_sym) & [:city, :country]).first || :world
@page = [params[:page].to_i, 1].max
@location = params.with_indifferent_access[@type].try(:downcase).try(:strip)
@language = get_language(params)
end

def get_language(params)
lang = params[:language] || "JavaScript"
URI.decode_www_form_component(lang)
@language = params[:language] || "JavaScript"
end

def languages
Expand Down
7 changes: 0 additions & 7 deletions spec/controllers/api/users_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ def response_hash
expect(first_user['world_rank']).to eq(1)
expect(first_user['stars_count']).to eq(3)
end

it 'should return c++ users when request has url encoded plus sign' do
get :index, language: "c%2B%2B", city: 'los angeles'

first_user = response_hash['users'].first
expect(first_user['login']).to eq('bb8')
end
end

context 'without scope' do
Expand Down