Skip to content
Snippets Groups Projects
Commit e45278a0 authored by Ilyaaaaaaaaaaaaa Zhitomirskiy's avatar Ilyaaaaaaaaaaaaa Zhitomirskiy
Browse files

notification for reshares WIP

parent 31733e1f
No related branches found
No related tags found
No related merge requests found
......@@ -8,11 +8,11 @@ Feature: Notifications
Given a user with email "bob@bob.bob"
And a user with email "alice@alice.alice"
When I sign in as "bob@bob.bob"
Scenario: someone shares with me
And I am on "alice@alice.alice"'s page
And I add the person to my 1st aspect
And I go to the destroy user session page
Scenario: someone shares with me
When I sign in as "alice@alice.alice"
And I follow "notifications" in the header
And I wait for the ajax to finish
......@@ -20,3 +20,21 @@ Feature: Notifications
Then I should see "started sharing with you"
When I follow "View all"
Then I should see "started sharing with you"
Scenario: someone re-shares my post
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
And "alice@alice.alice" has a public post with text "reshare this!"
And I am on "alice@alice.alice"'s page
And I preemptively confirm the alert
And I follow "Reshare"
And I wait for the ajax to finish
And I go to the destroy user session page
When I sign in as "alice@alice.alice"
And I follow "notifications" in the header
And I wait for the ajax to finish
Then the notification dropdown should be visible
Then I should see "reshared your post"
When I follow "View all"
Then I should see "reshared your post"
File moved
......@@ -51,6 +51,19 @@ describe Reshare do
end
end
describe '#notification_type' do
before do
@reshare = Factory.create(:reshare, :author => alice.person)
end
it 'does not return anything for the author' do
@reshare.notification_type(bob, @reshare.author).should be_nil
end
it 'returns private mesage for an actual receiver' do
@reshare.notification_type(alice, @reshare.author).should == Notifications::PrivateMessage
end
end
describe "XML" do
before do
@reshare = Factory(:reshare)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment