spec/tiddle_spec.rb in tiddle-0.1.0 vs spec/tiddle_spec.rb in tiddle-0.2.0
- old
+ new
@@ -17,19 +17,22 @@
end.to change { @user.authentication_tokens.count }.by(1)
end
it "sets last_used_at field" do
Tiddle.create_and_return_token(@user, FakeRequest.new)
- expect(@user.authentication_tokens.last.last_used_at).to be_within(1).of(DateTime.current)
+ expect(@user.authentication_tokens.last.last_used_at)
+ .to be_within(1).of(DateTime.current)
end
it "saves ip address" do
- Tiddle.create_and_return_token(@user, FakeRequest.new(remote_ip: "123.101.54.1"))
+ Tiddle.create_and_return_token @user,
+ FakeRequest.new(remote_ip: "123.101.54.1")
expect(@user.authentication_tokens.last.ip_address).to eq "123.101.54.1"
end
it "saves user agent" do
- Tiddle.create_and_return_token(@user, FakeRequest.new(user_agent: "Internet Explorer 4.0"))
+ Tiddle.create_and_return_token @user,
+ FakeRequest.new(user_agent: "Internet Explorer 4.0")
expect(@user.authentication_tokens.last.user_agent).to eq "Internet Explorer 4.0"
end
end
describe "expire_token" do