-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Odoo user profile * Add Specs * Lint files * Fix typo * Odoo member authorization * Fix user_valid method * Admin panel to manage odoo users * Fix i18n spec * Add spec for touch * Add specs * Use add_item instead of item * Fix spec * Add spec for show email * Add spec for contact * Task to sync all the users
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
namespace :decidim do | ||
namespace :odoo do | ||
# invoke with 'bundle exec rake "civicrm:sync:groups"' | ||
|
||
namespace :sync do | ||
desc "Sync members with Odoo API" | ||
task members: :environment do | ||
Decidim::Organization.find_each do |organization| | ||
Decidim::Odoo::SyncUsersJob.perform_later(organization.id) | ||
end | ||
end | ||
end | ||
end | ||
end |
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,14 @@ | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
|
||
describe "rake decidim:odoo:sync:members", type: :task do | ||
let(:count) { 5 } | ||
let!(:organizations) { create_list :organization, count } | ||
|
||
context "when executing task" do | ||
it "enqueues as jobs as organizations in the system" do | ||
expect { task.execute }.to have_enqueued_job(Decidim::Odoo::SyncUsersJob).exactly(count) | ||
end | ||
end | ||
end |