Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20230815160428_rename_plans_titles_with_legacy_plan_names_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 21c17a60e9057032b15a2bc177fc228ccc1715e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require 'spec_helper'
require_migration!

RSpec.describe RenamePlansTitlesWithLegacyPlanNames, feature_category: :subscription_management do
  let(:plans) { table(:plans) }

  let!(:premium_plan) { plans.create!(name: 'premium', title: 'Premium (Formerly Silver)') }
  let!(:ultimate_plan) { plans.create!(name: 'ultimate', title: 'Ultimate (Formerly Gold)') }

  describe '#up' do
    it 'updates the plan titles' do
      expect(premium_plan.title).to eq('Premium (Formerly Silver)')
      expect(ultimate_plan.title).to eq('Ultimate (Formerly Gold)')

      migrate!

      expect(premium_plan.reload.title).to eq('Premium')
      expect(ultimate_plan.reload.title).to eq('Ultimate')
    end
  end
end