-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close #760 show request booking order when payment_state is not paid
- Loading branch information
Showing
4 changed files
with
34 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe SpreeCmCommissioner::Notification, type: :model do | ||
|
||
describe "request_notifications" do | ||
it "return the latest notification if records have the same notification_id" do | ||
notification1 = create(:notification, | ||
type: 'order_requested_notification', | ||
read_at: nil, | ||
notificable_id: 1, | ||
notificable_type: 'Spree::Order' | ||
) | ||
notification2 = create(:notification, | ||
type: 'order_rejected_notification', | ||
read_at: nil, | ||
notificable_id: 1, | ||
notificable_type: 'Spree::Order' | ||
) | ||
|
||
notifications = SpreeCmCommissioner::Notification.request_notifications | ||
|
||
expect(notifications).to contain_exactly(notification2) | ||
end | ||
end | ||
end |