Remove unused Campaign model

The only way to use campaigns is to manually insert them in the
database, which IMHO isn't very practical.

We're going to change every piece of code that generates an Ahoy event
and, in this case, the easiest way to change the Campaing model so it
doesn't use Ahoy events is to simply remove it.

Note we're keeping the database tables until we release a new version,
just in case some Consul Democracy installations are using them. We'll
inform in the release notes that we'll remove the campaigns table after
the release, so existing installations using the `campaigns` table can
move the data somewhere else before we remove the table.
This commit is contained in:
Javi Martín
2024-04-24 02:26:03 +02:00
parent 0b2975194b
commit 448775a5e9
5 changed files with 8 additions and 58 deletions

View File

@@ -152,19 +152,21 @@ describe "Stats", :admin do
context "graphs" do
scenario "event graphs", :with_frozen_time do
campaign = create(:campaign)
visit new_debate_path
fill_in_new_debate_title with: "A title for a debate"
fill_in_ckeditor "Initial debate text", with: "This is very important because..."
check "debate_terms_of_service"
click_button "Start a debate"
visit root_path(track_id: campaign.track_id)
expect(page).to have_content "Sign out"
expect(page).to have_content "Debate created successfully."
visit admin_stats_path
within("#stats") do
click_link campaign.name
click_link "Debates"
end
expect(page).to have_content "#{campaign.name} (1)"
expect(page).to have_content "Debates (1)"
within("#graph") do
expect(page).to have_content Date.current.strftime("%Y-%m-%d")