spec/model/localized_notification_spec.rb in notifiable-rails-0.21.0 vs spec/model/localized_notification_spec.rb in notifiable-rails-0.21.1
- old
+ new
@@ -7,12 +7,20 @@
it { expect(Notifiable::LocalizedNotification.first.locale).to eq 'en' }
end
describe "#message" do
- subject!(:l) { create(:localized_notification, :message => "Test message") }
+ context "valid" do
+ subject!(:l) { create(:localized_notification, :message => "Test message") }
- it { expect(Notifiable::LocalizedNotification.first.message).to eq "Test message" }
+ it { expect(Notifiable::LocalizedNotification.first.message).to eq "Test message" }
+ end
+
+ context "empty" do
+ subject!(:l) { build(:localized_notification, :message => nil) }
+
+ it { expect{ l.save! }.to raise_error ActiveRecord::RecordInvalid }
+ end
end
describe "#params" do
subject!(:l) { create(:localized_notification, :params => {:custom_property => "A different message"}) }
\ No newline at end of file