2015-04-14 19:12:24 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
|
|
describe SignupHint do
|
|
|
|
|
|
2015-05-15 17:34:35 +00:00
|
|
|
let(:user) {AnonymousUser.new(SecureRandom.uuid, nil)}
|
2015-04-14 19:12:24 +00:00
|
|
|
|
|
|
|
|
describe "refresh_by_anoymous_user" do
|
|
|
|
|
it "creates" do
|
|
|
|
|
hint = SignupHint.refresh_by_anoymous_user(user, {redirect_location: 'abc'})
|
|
|
|
|
hint.errors.any?.should be_false
|
|
|
|
|
hint.redirect_location.should eq('abc')
|
|
|
|
|
hint.want_jamblaster.should be_false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it "updated" do
|
|
|
|
|
SignupHint.refresh_by_anoymous_user(user, {redirect_location: 'abc'})
|
|
|
|
|
|
|
|
|
|
hint = SignupHint.refresh_by_anoymous_user(user, {redirect_location: nil, want_jamblaster: true})
|
|
|
|
|
hint.errors.any?.should be_false
|
|
|
|
|
hint.redirect_location.should be_nil
|
|
|
|
|
hint.want_jamblaster.should be_true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|