Zfilipin has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/348774 )

Change subject: Echo should notify a user who watches a Flow board when another 
user creates a new topic there
......................................................................

Echo should notify a user who watches a Flow board when another user creates a 
new topic there

Bug: T14691
Change-Id: Ic36386c32753befbadf6cf0516bdf4646cb3e0e6
---
M tests/rspec/notification_spec.rb
1 file changed, 30 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/74/348774/1

diff --git a/tests/rspec/notification_spec.rb b/tests/rspec/notification_spec.rb
index a2a431e..70e7a65 100644
--- a/tests/rspec/notification_spec.rb
+++ b/tests/rspec/notification_spec.rb
@@ -127,4 +127,34 @@
     expect(flow_reply['timestamp']['date']).to eq 'Today'
   end
 
+  it 'should notify a user who watches a Flow board when another user creates 
a new topic there' do
+    page = 'Talk:' + SecureRandom.hex(5)
+    topic = SecureRandom.hex(5)
+    content = SecureRandom.hex(5)
+    @client.action(
+      'flow', submodule: 'new-topic', page: page, nttopic: topic,
+      ntcontent: content, ntformat: 'wikitext')
+
+    # adding to watchlist
+    @client.watch_page(page)
+
+    @client.create_account(@random_username, @random_password)
+    @client.log_in @random_username, @random_password
+
+    new_topic = SecureRandom.hex(5)
+    new_content = SecureRandom.hex(5)
+    @client.action(
+      'flow', submodule: 'new-topic', page: page, nttopic: new_topic,
+      ntcontent: new_content, ntformat: 'wikitext')
+
+    sleep 20
+    @client.log_in @admin_username, @admin_password
+
+    notifications = @client.query(meta: 
'notifications').data['notifications']['list']
+    flow_new_topic = notifications.last
+    expect(flow_new_topic['type']).to eq 'flow-new-topic'
+    expect(flow_new_topic['agent']['name']).to eq @random_username
+    expect(flow_new_topic['timestamp']['date']).to eq 'Today'
+  end
+
 end

-- 
To view, visit https://gerrit.wikimedia.org/r/348774
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic36386c32753befbadf6cf0516bdf4646cb3e0e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Zfilipin <[email protected]>
Gerrit-Reviewer: Etonkovidova <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to