Dandelion is a fair source project. View the code on Github · See the design guide
Commits on Nov 12, 2026
| 0c6adf8 |
Test who a mass email goes to and who may send one (test/messages/pmail_sending_test.rb): a mail to everyone, monthly donors, everyone else, an activity, a local group or an event's attendees reaches that list and never people who unsubscribed from it, the organisation or everything, nor anyone outside it, and leaves out an excluded event's attendees and local group's members; only an organisation's admins can write, preview, test or send its mails, not its followers or event managers, nor another organisation's admins through their own; activity, local group and event admins can mail only their own members; a test goes only to the admin sending it; a mail can be scheduled and rescheduled only through the organisation's own Mailgun account and not to event attendees; a sent mail can't be deleted, nor an unsent one viewed on the web; and clicks are counted per link and device, without recipients' tokens, only for the organisation's own mails. RecordedEmail keeps tags and headers, which pmails set |
| 3cb0c6a |
Test PayPal checkout through its API, with PayPal's HTTP answered by stubs (test/payments/paypal_checkout_test.rb): the PayPal order is for the order's total after a discount code and with its donation, in its currency, with its own organisation's credentials and idempotency key; an error from PayPal, an order without an approval link or PayPal being unreachable leaves no order or tickets, and refused credentials lock the event; an order the webhook and the return page both confirm is captured and its tickets sent once, also when two requests complete it at once; an order PayPal has captured already isn't captured again, the token is kept between requests, a refused capture completes the order only if PayPal then says it was captured, and refused credentials raise; a forged capture webhook, one for an order PayPal doesn't know, one to another organisation, malformed or of another type completes nothing; and refunds refund the whole capture, or one ticket's price, as the organisation, emailing the buyer, while one PayPal refuses emails the contacts the error and not the buyer a confirmation. It runs in the payments CI group |
| e82f4c0 |
Test activities' applications and follower settings (test/organisations/activity_applications_test.rb): an admin accepting an application from the list makes the applicant a hidden follower of a closed activity and emails them once, while the other statuses neither add nor email them; an applicant applies, sees their latest application and applies again, with no status control; followers hide and show the activity on their profile, admins choose whether they receive feedback; and with Rack, applicants, followers, strangers and the signed out can't see applications or set statuses, their own included, another activity's admin gets a 404 under their own activity's URL, accepting twice keeps one follower, the latest application is only the signed-in person's, closed and invitation-only activities can't be followed by oneself, followers can't add followers, edit the activity or preview its questions, admins can't set its protected fields, and a locked activity's page is its admins'. It runs in the general CI group |
| 66478c6 |
Count a limited discount code's uses as its orders again, as before 4e6cef2b5: counting only paid orders and unpaid ones within the hour's hold frees a use at most an hour before the hourly errand deletes an abandoned order anyway, and production has no unpaid order holding a limited code, so the subtler rule wasn't worth its query, docs claim and tests. The factory's for_event fix stays, used by a test |
| 086a8ad |
Don't check that a resent order confirmation was sent, only who it's to: Mailer sends an organisation's emails only where a Mailgun key is set, which a developer's shell may have and CI doesn't, so orders/admin failed in CI |
| fcce8aa |
Keep a gathering's last admin: its only admin can't leave, be removed or be unadmined, by anyone, site admins included (Membership#only_admin?), and isn't offered to: Leave gathering is disabled for them and their row says Only admin, with tooltips saying why. A site admin who isn't a member no longer crashes leaving. The docs say a gathering always keeps an admin, as a claim the tests cover. And validate what admins enter for a member: paid and invitations are whole numbers of 0 or more, shift points 0 or more, invitations and shift points blank to clear them, where anything was saved and the routes said 200 even when the save failed. They now return 422 with the error, which the members table's inline editing shows by the field (pagelets.js) rather than looking saved |
| 4e6cef2 |
Use up a limited discount code only with paid orders, and unpaid ones still within the hour they're held for while the buyer pays (DiscountCode#uses), so an abandoned checkout stops counting once its Stripe session expires rather than until the hourly errand deletes it; an order paid after all is restored and counts again. The codes list counts uses the same way. The docs say how uses are counted, as a claim the tests cover, and the discount_code factory's for_event trait names the codeable relation (it said codable) |
| 5bf40d4 |
Split Stripe payments so each payment's rows add up to what it charged: a fixed discount and credit applied (which was ignored) come off the whole order, spread across its ticket rows in proportion and rounded so the total is exact, and off its donations once the tickets are used up, as Bookings::Quote#running_total takes them; several percentage discounts compound per ticket as Ticket.discounted_price does, where only the last counted; amounts are read in the row's currency as Money formats it (€1.234,50, SEK 1,234.50, CHF 1'234.50...), where rows in anything but pounds were silently dropped; and a row whose description can't be read, or doesn't add up to its Amount, is kept as it is rather than lost. Amounts are written with two decimals as Stripe's export writes them |
| d3aede8 |
Count monthly contributions correctly: a partially refunded charge or application fee now counts what was kept, less Stripe's fee, which it keeps on a refund, where it counted the whole amount; the month's total is the sum of its parts cut to whole pounds, where the two were cut separately and could disagree (£10.60 + £10.60 gave 21 but 10 + 10); and months run midnight to midnight UTC, as Stripe's reports and StripeCharge and StripeTransaction do, where they ran in the server's local time zone, with this month and the 24 before it found in UTC too |
| d040535 |
Forget a Stripe account's details when an organisation or a member disconnects it: both disconnect routes cleared stripe_connect_json but kept stripe_account_json, so the old account's name and details stayed stored |
| b364062 |
Clear queued jobs between tests: reset! cleared only the app's models, so Delayed::Job rows a test queued counted in later tests, and a test counting the emails or jobs it queued could pass or fail by the order tests ran in. orders/admin no longer needs its baseline of earlier job ids |
| 753123d |
Test what coverage showed was untested and risky: the Stripe Connect webhook, connecting and disconnecting (payments/stripe_connect), discount codes (bookings/discount_codes), the order admin actions: restore and complete, restore a ticket, transfer, resend tickets, edit a ticket, clear answers (orders/admin), the Stripe row splitter and monthly contributions calculator (payments/stripe_row_splitter, payments/monthly_contributions), and gathering membership admin: make admin, paid, invitations, shift points, add member, leave (gatherings/members), each with Rack tests that the routes refuse who they should. 79 tests in six files, added to CI groups, events/boosts moving to calendar to make room in orders. Two bugs they found are fixed: restoring another event's (or a missing) deleted order or ticket raised a 500 rather than 404ing, and the Connect webhook raised a 500 on a bad signature or malformed body, where it now reports it and returns 200 as /o/:slug/stripe_webhook does. Coverage now runs only when asked for (Run workflow with coverage ticked, or gh workflow run Ruby -f coverage=true), as it slows every group and changes slowly |
| d9eff67 |
Measure test coverage with SimpleCov: each CI test group runs with COVERAGE=1 (test/test_coverage.rb), covering app, models and lib and the templates, and a coverage job collates the groups with rake test:coverage, putting the totals by area and the 30 files with the most uncovered lines in the run's summary and the HTML report in its coverage artifact. SimpleCov adds unrendered templates at 0% only for Rails' ActionView, so Padrino's are compiled at exit, without running them, so a template no test renders counts as uncovered rather than being left out. Locally, run a test file with COVERAGE=1 and open coverage/index.html |
| 1a3631c |
Split the eight test files of over a thousand lines into files of one subject each, and put the test files in a folder per area (test/accounts, events, bookings, orders, payments, organisations, gatherings, integrations, messages, tours), named without the area's prefix (event_hosts_test.rb is test/events/hosts_test.rb): since CI runs each group of files in one process, more files cost nothing, and 56 files are easier to find a test in. events, account_sign_ins, event_permissions, event_bookings, mcp, organisations, orders and webhooks become 26 files, their tests moved unchanged. Helpers the files on a subject share are in modules in test/helpers (BookingsHelpers, SignInHelpers, CheckoutWebhookHelpers...), with TestHelpers, which now has the helpers test_config.rb defined too, so test_config.rb is only setup. CI's groups name files by their path in test/, with a 15th group, payments, and rake test: |
| 197f165 |
Find records a route's URL names with *_from_params helpers that 404 themselves, in place of about 360 hand-written |
| 0be6e0f |
Show a restored draft's ticket type slots in the Slots dropdown (#306): rows cloned from the template while applying a draft got the draft's slots in the hidden number field, which is what's submitted, but the dropdown stayed on Standard, so a ticket type could show 1 place while saving 0, 2 or another number. syncSlotsChoice now sets the dropdown from the number after a row is filled in, choosing Other and showing the number for anything but 0, 1 or 2 Fixes #306 |
| 9b550f8 |
Update packages to the newest releases out of the 7-day cooldown, from script/update_packages.rb (the package updates workflow) (#305) |
| d9da90f |
Choose a ticket type's slots from Standard (1), Add-on (0), Couple (2) or Other, in place of a bare number field: 47 ticket types on future events had 0 slots, most of them by mistake (main tickets that then didn't count towards the event's capacity), and one had 8. Each choice says what it does to capacity, and starts with a word so a stray keystroke can't pick 0 or 2. Other shows the number field, which is what's submitted, and a ticket type with any other number opens on Other, so saving keeps it |
| d677e37 |
Run CI's tests in 14 groups of test files rather than a job per file, so a push's CI jobs all start at once: GitHub's Free plan runs 20 jobs at a time across the organisation, and with the lint job, CodeQL's 3 and Sentry release taking 5, 22 of the 37 test jobs waited for a free runner, as a second wave. Each group runs its files in one process (rake test:files, with TEST_FILES), balanced to about two minutes; test files keep one class each. test/lint_test.rb checks each test file is in one group, and that there are at most 15 groups (MAX_CI_TEST_GROUPS) |
| 58dd34b |
Retry a failing test on its own in CI, up to 3 times (TEST_ATTEMPTS in test/test_config.rb), rather than rerunning its whole file: each attempt is a fresh instance after reset!, and a test that passes on a later attempt prints a Flaky test warning to the run's summary, so flaky tests stay visible. Locally a test runs once. The file reruns only when it times out (retry_on: timeout, max_attempts: 2), which per-test retries can't catch |