25 lines
729 B
Ruby
25 lines
729 B
Ruby
require 'spec_helper'
|
|
|
|
describe SignupHint do
|
|
|
|
let(:user) {AnonymousUser.new(SecureRandom.uuid, nil)}
|
|
|
|
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
|