Skip to content

Commit

Permalink
Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed May 6, 2016
1 parent d57bcf2 commit 405f160
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions spec/controllers/sessions_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
referrer = "#{request.base_url}/account/edit"
request.env['HTTP_REFERER'] = referrer
get :new
session['user_return_to'].should be referrer
expect(session['user_return_to']).to eq referrer
end

it "should skip referrer if it's from other site" do
referrer = "http://#{SecureRandom.hex(4)}.com"
request.env['HTTP_REFERER'] = referrer
get :new
session['user_return_to'].should be_nil
expect(session['user_return_to']).to eq nil
end

it 'should skip referrer if it is user sign in page' do
referrer = "#{request.base_url}/account/sign_in"
request.env['HTTP_REFERER'] = referrer
get :new
session['user_return_to'].should be_nil
expect(session['user_return_to']).to eq nil
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

describe User, type: :model do
before do
User.any_instance.stub(:update_index).and_return(true)
allow_any_instance_of(User).to receive(:update_index).and_return(true)
end
let(:topic) { create :topic }
let(:user) { create :user }
Expand Down Expand Up @@ -66,7 +66,7 @@

describe '#read_topic?' do
before do
User.any_instance.stub(:update_index).and_return(true)
allow_any_instance_of(User).to receive(:update_index).and_return(true)
Rails.cache.write("user:#{user.id}:topic_read:#{topic.id}", nil)
end

Expand Down

0 comments on commit 405f160

Please sign in to comment.