Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

Fix issue with reputation attribute on User getting set to the API request reputation method #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion lib/serel/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def questions_unanswered
type(:question).url("users/#{id}/questions/unanswered")
end

def reputation
def rep
type(:reputation).url("users/#{id}/reputation")
end

Expand Down
8 changes: 4 additions & 4 deletions spec/serel/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
it "should get a users' reputation changes" do
VCR.use_cassette('users-reputation') do
user = Serel::User.find(821)
rep_changes = user.reputation.get
rep_changes = user.rep.get
rep_changes.should be_a(Serel::Response)

rep_changes.each do |rep|
Expand Down Expand Up @@ -194,20 +194,20 @@
# user = Serel::User.find(821)
# answers = user.top_answers_on('battlefield-3').get
# answers.should be_a(Serel::Response)
#
#
# answers.each do |answer|
# answer.should be_a(Serel::Answer)
# answer.owner.id.should == user.id
# end
# end
# end
#
#
# it "should get a users' top answers in several tags" do
# VCR.use_cassette('user-top-answers-multiple-tags') do
# user = Serel::User.find(821)
# answers = user.top_answers_on('battlefield-3', 'minecraft').get
# answers.should be_a(Serel::Response)
#
#
# answers.each do |answer|
# answer.should be_a(Serel::Answer)
# answer.owner.id.should == user.id
Expand Down