1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

Merge branch 'dev' for release 5.1.12

This commit is contained in:
Sylvain 2021-11-10 17:08:34 +01:00
commit c35c4d8ffd
6 changed files with 64 additions and 12 deletions

View File

@ -1,5 +1,10 @@
# Changelog Fab-manager
## v5.1.12 2021 November 10
- Added an automated test on the plan creation endpoint
- Fix a bug: unable to create a plan
## v5.1.11 2021 October 22
- Refactored subscription new/renew/free extend interfaces and API

View File

@ -1,4 +1,4 @@
web: bundle exec rails server puma -p $PORT
#web: bundle exec rails server puma -p $PORT
worker: bundle exec sidekiq -C ./config/sidekiq.yml
wp-client: bin/webpack-dev-server
wp-server: SERVER_BUNDLE_ONLY=yes bin/webpack --watch

View File

@ -132,6 +132,6 @@ class Plan < ApplicationRecord
end
def update_gateway_product
PaymentGatewayService.new.create_or_update_product(Plan.base_name, id)
PaymentGatewayService.new.create_or_update_product(Plan.name, id)
end
end

View File

@ -507,8 +507,8 @@
this_will_never_be_added_when_a_refund_notice_is_present: "Dette vil aldri bli lagt til når det foreligger en refusjonsvarsel."
eg_XVL_will_add_VL_to_the_invoices_settled_by_card: '(eks. X[/VL] vil legge til "/VL" i fakturaene som gjøres opp elektronisk)'
add_a_notice_regarding_refunds_only_if_the_invoice_is_concerned: "Legg til et varsel om det elektroniske salget om en faktura er klar."
this_will_never_be_added_when_an_online_sales_notice_is_present: "This will never be added when an online sales notice is present."
eg_RA_will_add_A_to_the_refund_invoices: '(eg. R[/A] will add "/A" to the refund invoices)'
this_will_never_be_added_when_an_online_sales_notice_is_present: "Dette vil aldri bli lagt til når en nettbasert salgsvarsel er tilstede."
eg_RA_will_add_A_to_the_refund_invoices: '(eks. R[/A] vil legge "/A" til refusjonsfakturaene)'
add_a_notice_regarding_payment_schedule: "Legg til en melding om betalingsplaner, kun for berørte dokumenter."
this_will_never_be_added_with_other_notices: "Dette vil aldri bli lagt til når det foreligger andre notater."
eg_SE_to_schedules: '(eg. S[/E] will add "/E" to the payment schedules)'
@ -866,7 +866,7 @@
expires_at: "Utløper:"
price_: "Pris:"
offer_free_days: "Tilby gratis dager"
renew_subscription: "Renew the subscription"
renew_subscription: "Forny abonnementet"
user_has_no_current_subscription: "Brukeren har ikke noe gjeldende medlemskap."
subscribe_to_a_plan: "Abonner på et medlemskap"
trainings: "Opplæringer/kurs"
@ -901,13 +901,13 @@
cannot_extend_own_subscription: "Du kan ikke utvide ditt eget medlemskap. Be en annen leder eller en administrator om å utvide abonnementet."
#extend a subscription for free
free_extend_modal:
extend_subscription: "Extend the subscription"
offer_free_days_infos: "You are about to extend the user's subscription by offering him free additional days."
credits_will_remain_unchanged: "The balance of free credits (training / machines / spaces) of the user will remain unchanged."
current_expiration: "Current subscription will expire at:"
extend_subscription: "Forleng abonnementet"
offer_free_days_infos: "Du er i ferd med å forlenge brukerens abonnement ved å tilby ham gratis ekstra dager."
credits_will_remain_unchanged: "Brukernes gjenværende kreditter (opplæring / maskiner/lokaler) vil ikke bli endret."
current_expiration: "Gjeldende abonnement vil utløpe på:"
DATE_TIME: "{DATE} {TIME}"
new_expiration_date: "New expiration date:"
number_of_free_days: "Number of free days:"
new_expiration_date: "Ny utløpsdato:"
number_of_free_days: "Antall gratis dager:"
extend: "Extend"
extend_success: "The subscription was successfully extended for free"
#renew a subscription

View File

@ -1,6 +1,6 @@
{
"name": "fab-manager",
"version": "5.1.11",
"version": "5.1.12",
"description": "Fab-manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.",
"keywords": [
"fablab",

View File

@ -0,0 +1,47 @@
# frozen_string_literal: true
require 'test_helper'
class CreatePlanTest < ActionDispatch::IntegrationTest
setup do
admin = User.with_role(:admin).first
login_as(admin, scope: :user)
end
test 'create a plan' do
plans_count = Plan.count
post '/api/plans',
params: {
plan: {
base_name: 'Abonnement test',
type: 'Plan',
group_id: 1,
plan_category_id: nil,
interval: 'week',
interval_count: 2,
amount: 10,
ui_weight: 0,
is_rolling: true,
monthly_payment: false,
description: 'lorem ipsum dolor sit amet',
partner_id: '',
plan_file_attributes: {
id: nil,
_destroy: nil,
attachment: nil
}
}
}.to_json,
headers: default_headers
# Check response format & status
assert_equal 201, response.status, response.body
assert_equal Mime[:json], response.content_type
# Check the created plan
plan = json_response(response.body)
assert_equal Plan.last.id, plan[:id]
assert_equal plans_count + 1, Plan.count
end
end