mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
It contains a fix for stimulus_reflex 3.5.0-rc4, but hasn't been released yet. https://github.com/podia/stimulus_reflex_testing/issues/21 Now the user reflex spec works, but the products spec needs another fix. But we plan to remove it soon anyway.
24 lines
718 B
Ruby
24 lines
718 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "reflex_helper"
|
|
|
|
RSpec.describe UserReflex, type: :reflex do
|
|
let(:current_user) { create(:user) }
|
|
let(:context) { { url: spree.admin_dashboard_url, connection: { current_user: } } }
|
|
|
|
describe "#accept_terms_of_services" do
|
|
subject(:reflex) { build_reflex(method_name: :accept_terms_of_services, **context) }
|
|
|
|
it "updates terms_of_service_accepted_at" do
|
|
expect {
|
|
reflex.run(:accept_terms_of_services)
|
|
current_user.reload
|
|
}.to change{ current_user.terms_of_service_accepted_at }
|
|
end
|
|
|
|
it "removes banner from the page" do
|
|
expect(reflex.run(:accept_terms_of_services)).to morph("#banner-container").with("")
|
|
end
|
|
end
|
|
end
|