diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-07-28 03:03:06 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-08-15 21:17:58 +0300 |
commit | 95419679f23f0628d1885dd9656cc159e9d55ea9 (patch) | |
tree | 4ec924b2f7dfbfd9e0390065d430c9daff8984bb /spec/models/user_agent_detail_spec.rb | |
parent | 640e485c6aa19f8fca1be7fc45e7f65da4469fbd (diff) |
Lay the ground works to submit information to Akismet
- New concern `AkismetSubmittable` to allow issues and other `Spammable` models to be submitted to Akismet.
- New model `UserAgentDetail` to store information needed for Akismet.
- Services needed for their creation and tests.
Diffstat (limited to 'spec/models/user_agent_detail_spec.rb')
-rw-r--r-- | spec/models/user_agent_detail_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/models/user_agent_detail_spec.rb b/spec/models/user_agent_detail_spec.rb new file mode 100644 index 00000000000..8debcbbeba6 --- /dev/null +++ b/spec/models/user_agent_detail_spec.rb @@ -0,0 +1,22 @@ +require 'rails_helper' + +describe UserAgentDetail, type: :model do + describe '.submittable?' do + it 'should be submittable' do + detail = create(:user_agent_detail, :on_issue) + expect(detail.submittable?).to be_truthy + end + end + + describe '.valid?' do + it 'should be valid with a subject' do + detail = create(:user_agent_detail, :on_issue) + expect(detail).to be_valid + end + + it 'should not be valid without a subject' do + detail = build(:user_agent_detail) + expect(detail).not_to be_valid + end + end +end |