docbrown/spec/tasks/metrics_spec.rb
dependabot[bot] 9066de9b65
Bump rubocop-rails from 2.9.1 to 2.10.0 (#13655)
* Bump rubocop-rails from 2.9.1 to 2.10.0

Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.9.1 to 2.10.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.9.1...v2.10.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Add new cops and fix violations

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rhymes <rhymes@hey.com>
2021-05-05 14:16:44 -07:00

24 lines
753 B
Ruby

require "rails_helper"
RSpec.describe "Metrics Overview task", type: :task do
before do
Rake::Task.clear
PracticalDeveloper::Application.load_tasks
end
describe "#overview" do
let(:event_name) { "Admin Overview Link Clicked" }
let(:click_target) { "https://forem.gitbook.io/forem-admin-guide/quick-start-guide" }
let(:host) { ENV["APP_DOMAIN"] }
it "returns the event count and target for admin overview events" do
create(:ahoy_event, name: event_name, properties: {
action: "click", target: click_target
})
expect { Rake::Task["metrics:overview"].invoke }.to output(
"Admin Overview Link Tracking for #{host}:\n#{click_target}: 1\n",
).to_stdout
end
end
end