diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 592b2ced..cae49725 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,15 +1,15 @@ -name: build +name: Build on: workflow_dispatch: - push: - branches: [ $default-branch ] pull_request: - branches: [ $default-branch ] + branches: + - main jobs: test: runs-on: ubuntu-latest + name: Run specs strategy: matrix: ruby-version: ['2.7'] diff --git a/spec/requests/analytics_spec.rb b/spec/requests/analytics_spec.rb index c1b495dc..5c9de18c 100644 --- a/spec/requests/analytics_spec.rb +++ b/spec/requests/analytics_spec.rb @@ -1,14 +1,16 @@ RSpec.describe 'Analytics flow', type: :request do before do + model = Class.new(Candidate) do + include DfE::Analytics::Entities + end + + stub_const('Candidate', model) + controller = Class.new(ApplicationController) do include DfE::Analytics::Requests def index - model = Class.new(Candidate) do - include DfE::Analytics::Entities - end - - model.create( + Candidate.create( email_address: 'a@b.com', first_name: 'Mr', last_name: 'Knox'