-Given /^une liste ag@ avec comme emails inscrits:$/ do |subscriber_list|
- emails = subscriber_list.strip.split
- init_mailman_mock_db('ag' => emails)
+Then 'la liste ag@ doit avoir reçu l’inscription de {string}' do |email|
+ expect(
+ a_request(:post, "https://mailman.example.org/3.0/members").
+ with(headers: {'Content-Type': 'application/json'},
+ body: hash_including(
+ {"list_id": "ag.nos-oignons.net",
+ "subscriber": email,
+ "pre_verified": true,
+ "pre_confirmed": true,
+ "pre_approved": true,
+ }
+ ),
+ )).to have_been_made
+end
+
+Then 'la liste ag@ ne doit pas avoir reçu d’inscription' do
+ expect(
+ a_request(:post, "https://mailman.example.org/3.0/members")
+ ).not_to have_been_made