Commit graph

9 commits

Author SHA1 Message Date
Anna Buianova
7d053471f8
Rubocop fixes in spec/requests (#18946)
* Rubocop fixes in spec/requests

* Fixed spec/requests/api/v0/articles_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-01-12 19:10:16 +03:00
Anna Buianova
455399bdba
Rubocop fixes (#18461)
* Rubocop fixes

* Fixed most Capybara/SpecificMatcher violations

* Moved flash notice texts to locales
2022-09-16 15:25:48 +03:00
Fernando Valverde
75a722bd6e
ForemMobile namespaced functions (#15212)
* window.ForemMobile namespaced functions

* Fix broken Buildkite

* Wait for data-loaded before using Runtime in pack

* Bring back sprockets base

* Better error handling

* Smal fixes to ConsumerApp to support Android platform

* Fix typo

* utilities/waitForDataLoaded.js

* Update app/javascript/utilities/waitForDataLoaded.js

Co-authored-by: Nick Taylor <nick@forem.com>

* Review feedback

* Fix failing spec

* Cleanup promise

* Remove old utility file

* Add Cypress check for namespaced availability

* More specs

* Refactor to rely on ForemMobile for native bridge messaging

* Fix spec/requests/api/v0/instances_spec.rb

* Fix devices spec

* Remove changes to /api/instance

* Refactor to dynamic import

* Fix typo

* Fixed custom event detail payload for tests.

* mock ForemMobile function instead of webkit call directly

* failing jest test debug

* Another attempt

* Fixed broken test that was missing an onMainImageUrlChange prop on the component.

* Fixed mobile bridging E2E tests.

* Move Cypress tests to mobileFlows

* Add JSDocs + cypress spec for injectJSMessage when logged out

* Cleanup + Disable native image upload until AppStore approval

Co-authored-by: Nick Taylor <nick@forem.com>
Co-authored-by: Nick Taylor <nick@dev.to>
2021-11-23 15:25:29 -06:00
rhymes
cf9f6094cd
Have specs run without Redis and refactor ConsumerApp and Device (#13647)
* Add fakeredis gem

* Mock Pusher::PushNotifications in specs

* Remove Redis from Travis

* Add Android tests to ConsumerApp specs

* Use mock for push notification tests and refactor ConsumerApp and Device code

* Fix remaining broken specs

* Use symbols

* Cleanup rpush helpers

* Pusher::PushNotifications is no more

* Use human friendly platform in Admin::ConsumerApps index page
2021-05-07 08:03:16 +02:00
Fernando Valverde
121603a44b
Replace Pusher Beams with Rpush PN delivery ✂️ ✂️ (#13588)
* Remove feature flag

* Remove Pusher Beams implementation

* Remove Pusher Beams require from initializer

* Adds consumer apps to sidebar + consider :admin_restructure

* Fix routes + PN target URL

* Remove old file that sneaked in

* Adds docs

* docs tweaks

* Apply suggestions from code review

Co-authored-by: rhymes <rhymes@hey.com>

Co-authored-by: rhymes <rhymes@hey.com>
2021-05-05 08:37:20 -06:00
Fernando Valverde
e602d50d32
Push Notification multi app support (#13304)
* PushNotificationTarget model + /admin/push_notifications (index)

* Admin panel CRUD + request tests

* Migrate Redis backed Rpush model responsibilities into PushNotificationTarget

* Fix failing specs

* Fix conflicts + clean up test by using constant reference

* Removed unused policy

* policy + services + misc feedback

* PushNotificationTarget refactored to AppIntegration

* Review feedback

* Some small cleanup

* Refactor AppIntegration -> ConsumerApp

* Fixing specs

* Trigger Travis

* More naming refactor changes

* Refactor services into queries

* Revert to where(...).first, fix typo and tests

* Apply suggestions from code review

Co-authored-by: rhymes <rhymes@hey.com>

* PR review feedback - create_or_find_by, validations, renaming + more tests

* Fix aria-label text

* Remove unnecessary individual index - composite index will do

Co-authored-by: rhymes <rhymes@hey.com>
2021-04-21 17:13:01 -06:00
Fernando Valverde
1d1771eb97
[15min fix] Return Device ID upon registration (#13427)
* Return Device ID upon registration

* Update app/controllers/devices_controller.rb

Co-authored-by: rhymes <rhymes@hey.com>

* Add check for status code in spec

Co-authored-by: rhymes <rhymes@hey.com>
2021-04-19 08:32:57 -06:00
Fernando Valverde
d6fde3ab89
Change PushNotifications::Send to use user_ids (#13036)
* Changes PushNotifications::Send to use user_ids

* Changes devices#destroy to use unauthenticated_params

* Fix failing spec - new logic reverses order

* Apply suggestions from code review

Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>

* Only send new_comment PN with Rpush behind FeatureFlag + spec tweak

* Add query order explicitly to avoid flakyness

* Review feedback - remove order clause in query & other tweaks

Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>
2021-03-19 13:50:04 -06:00
Josh Puetz
7f164c2da3
Add test for DevicesController (#12985)
* Add test for DevicesController

* Remove defensive calls
2021-03-16 08:33:25 -05:00