Every campaign has an end.

Drop ahoy, because it's more trouble than it's worth. This means dropping
visits, campaigns, targets.

Campaigns are better run to analytics, such as:
* https://matomo.org/docs/tracking-campaigns/
* https://matomo.org/docs/tracking-goals-web-analytics/
* https://support.google.com/analytics/answer/1012040?hl=en
This commit is contained in:
James Mason 2018-10-08 17:58:41 -07:00 committed by Henne Vogelsang
parent 62056fc044
commit b11001cdba
47 changed files with 19 additions and 1420 deletions

View file

@ -1,55 +0,0 @@
# frozen_string_literal: true
require 'spec_helper'
feature Campaign do
let!(:conference) { create(:conference, short_title: 'osc14') }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
let!(:organizer) { create(:user, role_ids: [organizer_role.id]) }
shared_examples 'add and update campaign' do
scenario 'adds and update a campaign', feature: true, js: true do
expected_count = Campaign.count + 1
sign_in organizer
visit admin_conference_campaigns_path(conference.short_title)
click_link 'New Campaign'
click_button 'Create Campaign'
expect(flash).to eq("Campaign creation failed. Name can't be blank and Utm campaign can't be blank")
fill_in 'campaign_name', with: 'Test Campaign'
fill_in 'campaign_utm_campaign', with: 'campaign'
fill_in 'campaign_utm_source', with: 'source'
fill_in 'campaign_utm_medium', with: 'medium'
fill_in 'campaign_utm_term', with: 'term'
fill_in 'campaign_utm_content', with: 'content'
click_button 'Create Campaign'
# Validations
expect(flash).to eq('Campaign successfully created.')
expect(page).to have_selector('[id^="name_"]', text: 'Test Campaign')
expect(page).to have_selector('[id^="visits_"]', text: '0')
expect(page).to have_selector('[id^="registrations_"]', text: '0')
expect(page).to have_selector('[id^="submissions_"]', text: '0')
expect(Campaign.count).to eq(expected_count)
campaign = Campaign.where('name' => 'Test Campaign').first
visit edit_admin_conference_campaign_path(conference.short_title, campaign.id)
fill_in 'campaign_name', with: 'Test Campaign 42'
click_button 'Update Campaign'
expect(flash).to eq("Campaign 'Test Campaign 42' successfully updated.")
end
end
describe 'organizer' do
it_behaves_like 'add and update campaign'
end
end

View file

@ -43,9 +43,6 @@ feature 'Has correct abilities' do
expect(page).to_not have_link('Sponsorship Levels', href: "/admin/conferences/#{conference.short_title}/sponsorship_levels")
expect(page).to_not have_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors")
expect(page).to_not have_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets")
expect(page).to_not have_text('Objectives')
expect(page).to_not have_link('Campaigns', href: "/admin/conferences/#{conference.short_title}/campaigns")
expect(page).to_not have_link('Goals', href: "/admin/conferences/#{conference.short_title}/targets")
expect(page).to have_link('Roles', href: "/admin/conferences/#{conference.short_title}/roles")
expect(page).to have_link('Resources', href: "/admin/conferences/#{conference.short_title}/resources")
expect(page).to_not have_link('New Conference', href: '/admin/conferences/new')
@ -250,26 +247,6 @@ feature 'Has correct abilities' do
visit edit_admin_conference_ticket_path(conference.short_title, conference.tickets.first)
expect(current_path).to eq(root_path)
visit admin_conference_campaigns_path(conference.short_title)
expect(current_path).to eq(root_path)
visit new_admin_conference_campaign_path(conference.short_title)
expect(current_path).to eq(root_path)
create(:campaign, conference: conference)
visit edit_admin_conference_campaign_path(conference.short_title, conference.campaigns.first)
expect(current_path).to eq(root_path)
visit admin_conference_targets_path(conference.short_title)
expect(current_path).to eq(root_path)
visit new_admin_conference_target_path(conference.short_title)
expect(current_path).to eq(root_path)
create(:target, conference: conference)
visit edit_admin_conference_target_path(conference.short_title, conference.targets.first)
expect(current_path).to eq(root_path)
visit admin_conference_roles_path(conference.short_title)
expect(current_path).to eq(admin_conference_roles_path(conference.short_title))

View file

@ -29,9 +29,6 @@ feature 'Has correct abilities' do
expect(page).to_not have_link('Sponsorship Levels', href: "/admin/conferences/#{conference.short_title}/sponsorship_levels")
expect(page).to_not have_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors")
expect(page).to_not have_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets")
expect(page).to_not have_text('Objectives')
expect(page).to_not have_link('Campaigns', href: "/admin/conferences/#{conference.short_title}/campaigns")
expect(page).to_not have_link('Goals', href: "/admin/conferences/#{conference.short_title}/targets")
expect(page).to have_link('Roles', href: "/admin/conferences/#{conference.short_title}/roles")
expect(page).to have_link('Resources', href: "/admin/conferences/#{conference.short_title}/resources")
expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard')
@ -128,26 +125,6 @@ feature 'Has correct abilities' do
visit edit_admin_conference_ticket_path(conference.short_title, conference.tickets.first)
expect(current_path).to eq(root_path)
visit admin_conference_campaigns_path(conference.short_title)
expect(current_path).to eq(root_path)
visit new_admin_conference_campaign_path(conference.short_title)
expect(current_path).to eq(root_path)
create(:campaign, conference: conference)
visit edit_admin_conference_campaign_path(conference.short_title, conference.campaigns.first)
expect(current_path).to eq(root_path)
visit admin_conference_targets_path(conference.short_title)
expect(current_path).to eq(root_path)
visit new_admin_conference_target_path(conference.short_title)
expect(current_path).to eq(root_path)
create(:target, conference: conference)
visit edit_admin_conference_target_path(conference.short_title, conference.targets.first)
expect(current_path).to eq(root_path)
visit admin_conference_roles_path(conference.short_title)
expect(current_path).to eq(admin_conference_roles_path(conference.short_title))

View file

@ -52,9 +52,6 @@ feature 'Has correct abilities' do
expect(page).to have_link('Sponsorship Levels', href: "/admin/conferences/#{conference.short_title}/sponsorship_levels")
expect(page).to have_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors")
expect(page).to have_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets")
expect(page).to have_text('Objectives')
expect(page).to have_link('Campaigns', href: "/admin/conferences/#{conference.short_title}/campaigns")
expect(page).to have_link('Goals', href: "/admin/conferences/#{conference.short_title}/targets")
expect(page).to have_link('E-Mails', href: "/admin/conferences/#{conference.short_title}/emails")
expect(page).to have_link('Roles', href: "/admin/conferences/#{conference.short_title}/roles")
expect(page).to have_link('Resources', href: "/admin/conferences/#{conference.short_title}/resources")
@ -236,26 +233,6 @@ feature 'Has correct abilities' do
visit edit_admin_conference_ticket_path(conference.short_title, conference.tickets.first)
expect(current_path).to eq(edit_admin_conference_ticket_path(conference.short_title, conference.tickets.first))
visit admin_conference_campaigns_path(conference.short_title)
expect(current_path).to eq(admin_conference_campaigns_path(conference.short_title))
visit new_admin_conference_campaign_path(conference.short_title)
expect(current_path).to eq(new_admin_conference_campaign_path(conference.short_title))
create(:campaign, conference: conference)
visit edit_admin_conference_campaign_path(conference.short_title, conference.campaigns.first)
expect(current_path).to eq(edit_admin_conference_campaign_path(conference.short_title, conference.campaigns.first))
visit admin_conference_targets_path(conference.short_title)
expect(current_path).to eq(admin_conference_targets_path(conference.short_title))
visit new_admin_conference_target_path(conference.short_title)
expect(current_path).to eq(new_admin_conference_target_path(conference.short_title))
create(:target, conference: conference)
visit edit_admin_conference_target_path(conference.short_title, conference.targets.first)
expect(current_path).to eq(edit_admin_conference_target_path(conference.short_title, conference.targets.first))
visit admin_conference_program_tracks_path(conference.short_title)
expect(current_path).to eq(admin_conference_program_tracks_path(conference.short_title))

View file

@ -55,9 +55,6 @@ feature 'Has correct abilities' do
expect(page).to have_link('Sponsorship Levels', href: "/admin/conferences/#{conference.short_title}/sponsorship_levels")
expect(page).to have_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors")
expect(page).to have_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets")
expect(page).to have_text('Objectives')
expect(page).to have_link('Campaigns', href: "/admin/conferences/#{conference.short_title}/campaigns")
expect(page).to have_link('Goals', href: "/admin/conferences/#{conference.short_title}/targets")
expect(page).to have_link('E-Mails', href: "/admin/conferences/#{conference.short_title}/emails")
expect(page).to have_link('Roles', href: "/admin/conferences/#{conference.short_title}/roles")
expect(page).to have_link('Resources', href: "/admin/conferences/#{conference.short_title}/resources")
@ -242,26 +239,6 @@ feature 'Has correct abilities' do
visit edit_admin_conference_ticket_path(conference.short_title, conference.tickets.first)
expect(current_path).to eq(edit_admin_conference_ticket_path(conference.short_title, conference.tickets.first))
visit admin_conference_campaigns_path(conference.short_title)
expect(current_path).to eq(admin_conference_campaigns_path(conference.short_title))
visit new_admin_conference_campaign_path(conference.short_title)
expect(current_path).to eq(new_admin_conference_campaign_path(conference.short_title))
create(:campaign, conference: conference)
visit edit_admin_conference_campaign_path(conference.short_title, conference.campaigns.first)
expect(current_path).to eq(edit_admin_conference_campaign_path(conference.short_title, conference.campaigns.first))
visit admin_conference_targets_path(conference.short_title)
expect(current_path).to eq(admin_conference_targets_path(conference.short_title))
visit new_admin_conference_target_path(conference.short_title)
expect(current_path).to eq(new_admin_conference_target_path(conference.short_title))
create(:target, conference: conference)
visit edit_admin_conference_target_path(conference.short_title, conference.targets.first)
expect(current_path).to eq(edit_admin_conference_target_path(conference.short_title, conference.targets.first))
visit admin_conference_booths_path(conference.short_title)
expect(current_path).to eq(admin_conference_booths_path(conference.short_title))

View file

@ -43,9 +43,6 @@ feature 'Has correct abilities' do
expect(page).to_not have_link('Sponsorship Levels', href: "/admin/conferences/#{conference.short_title}/sponsorship_levels")
expect(page).to_not have_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors")
expect(page).to_not have_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets")
expect(page).to_not have_text('Objectives')
expect(page).to_not have_link('Campaigns', href: "/admin/conferences/#{conference.short_title}/campaigns")
expect(page).to_not have_link('Goals', href: "/admin/conferences/#{conference.short_title}/targets")
expect(page).to_not have_link('E-Mails', href: "/admin/conferences/#{conference.short_title}/emails")
expect(page).to have_link('Roles', href: "/admin/conferences/#{conference.short_title}/roles")
expect(page).to_not have_link('Resources', href: "/admin/conferences/#{conference.short_title}/resources")
@ -192,26 +189,6 @@ feature 'Has correct abilities' do
visit edit_admin_conference_ticket_path(conference.short_title, conference.tickets.first)
expect(current_path).to eq root_path
visit admin_conference_campaigns_path(conference.short_title)
expect(current_path).to eq root_path
visit new_admin_conference_campaign_path(conference.short_title)
expect(current_path).to eq root_path
create(:campaign, conference: conference)
visit edit_admin_conference_campaign_path(conference.short_title, conference.campaigns.first)
expect(current_path).to eq root_path
visit admin_conference_targets_path(conference.short_title)
expect(current_path).to eq root_path
visit new_admin_conference_target_path(conference.short_title)
expect(current_path).to eq root_path
create(:target, conference: conference)
visit edit_admin_conference_target_path(conference.short_title, conference.targets.first)
expect(current_path).to eq root_path
visit admin_conference_program_tracks_path(conference.short_title)
expect(current_path).to eq admin_conference_program_tracks_path(conference.short_title)

View file

@ -374,18 +374,6 @@ feature 'Version' do
expect(page).to have_text("Someone (probably via the console) unregistered #{organizer.name} from event #{event.title} in conference #{conference.short_title}")
end
scenario 'display changes in target', feature: true, versioning: true, js: true do
target = create(:target, conference: conference)
target.update_attributes(due_date: Date.today, target_count: 1000)
target_id = target.id
target.destroy
visit admin_revision_history_path
expect(page).to have_text("Someone (probably via the console) created new target 1000 Submissions by #{Date.today} with ID #{target_id} in conference #{conference.short_title}")
expect(page).to have_text("Someone (probably via the console) updated due date and target count of target 1000 Submissions by #{Date.today} with ID #{target_id} in conference #{conference.short_title}")
expect(page).to have_text("Someone (probably via the console) deleted target 1000 Submissions by #{Date.today} with ID #{target_id} in conference #{conference.short_title}")
end
scenario 'display changes in comment', feature: true, versioning: true, js: true do
create(:event, program: conference.program, title: 'My first event')
event = create(:event, program: conference.program, title: 'My second event')
@ -416,18 +404,6 @@ feature 'Version' do
expect(page).to have_text("Someone (probably via the console) re-added #{organizer.name}'s vote on event #{event.title} in conference #{conference.short_title}")
end
scenario 'display changes in campaign', feature: true, versioning: true, js: true do
campaign = create(:campaign, conference: conference, name: 'Test Campaign', utm_campaign: 'campaign')
campaign.update_attributes(utm_source: 'source', utm_medium: 'medium', utm_term: 'term', utm_content: 'content')
campaign_id = campaign.id
campaign.destroy
visit admin_revision_history_path
expect(page).to have_text("Someone (probably via the console) created new campaign Test Campaign with ID #{campaign_id} in conference #{conference.short_title}")
expect(page).to have_text("Someone (probably via the console) updated utm source, utm medium, utm term and utm content of campaign Test Campaign with ID #{campaign_id} in conference #{conference.short_title}")
expect(page).to have_text("Someone (probably via the console) deleted campaign Test Campaign with ID #{campaign_id} in conference #{conference.short_title}")
end
scenario 'display password reset requests', feature: true, versioning: true, js: true do
user = create(:user)
user.send_reset_password_instructions