diff --git a/.github/workflows/mysql.yml b/.github/workflows/mysql.yml index 6d95f1c..f2f1dbb 100644 --- a/.github/workflows/mysql.yml +++ b/.github/workflows/mysql.yml @@ -10,7 +10,6 @@ DB_ADAPTER: mysql2 MYSQL_PWD: root RAILS_ENV: test - WICKED_PDF_PATH: vendor/bundle/bin/wkhtmltopdf steps: # Checkout the repo @@ -74,6 +73,10 @@ ${{ runner.os }}-yarn- ${{ runner.os }}- + # Figure out where wkhtmltopdf is installed + - name: 'Determine wkhtmltopdf location' + run: echo ::set-env name=WICKED_PDF_PATH::$(echo `bundle exec which wkhtmltopdf`) + # Install the JS dependencies - name: 'Yarn Install' run: | diff --git a/.github/workflows/postgres.yml b/.github/workflows/postgres.yml index cd08ba4..c6f5ce1 100644 --- a/.github/workflows/postgres.yml +++ b/.github/workflows/postgres.yml @@ -9,7 +9,13 @@ services: # Postgres installation db: - image: postgres:11 + image: postgres + env: + # Latest version of Postgres has increased security. We can use the default + # user/password in this testing scenario though so use the following env + # variable to bypass this changes: + # https://github.com/docker-library/postgres/issues/681 + POSTGRES_HOST_AUTH_METHOD: trust ports: ['5432:5432'] options: >- --health-cmd pg_isready @@ -20,7 +26,6 @@ env: RAILS_ENV: test DATABASE_URL: postgres://postgres:@localhost:5432/roadmap_test - WICKED_PDF_PATH: vendor/bundle/bin/wkhtmltopdf steps: # Checkout the repo @@ -38,6 +43,7 @@ - name: 'Determine Ruby Version' run: echo ::set-env name=RUBY_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`) + # Install Ruby - using the version found in the Gemfile.lock - name: 'Install Ruby' uses: actions/setup-ruby@v1 @@ -84,6 +90,10 @@ ${{ runner.os }}-yarn- ${{ runner.os }}- + # Figure out where wkhtmltopdf is installed + - name: 'Determine wkhtmltopdf location' + run: echo ::set-env name=WICKED_PDF_PATH::$(echo `bundle exec which wkhtmltopdf`) + # Install the JS dependencies - name: 'Yarn Install' run: | diff --git a/spec/helpers/usage_helper_spec.rb b/spec/helpers/usage_helper_spec.rb index a77f0d2..84ddd92 100644 --- a/spec/helpers/usage_helper_spec.rb +++ b/spec/helpers/usage_helper_spec.rb @@ -47,8 +47,8 @@ context "with data" do before(:each) do - @template1 = { name: Faker::Lorem.word, count: Faker::Number.number(digits: 1) } - @template2 = { name: Faker::Lorem.word, count: Faker::Number.number(digits: 1) } + @template1 = { name: Faker::Lorem.unique.word, count: Faker::Number.number(digits: 1) } + @template2 = { name: Faker::Lorem.unique.word, count: Faker::Number.number(digits: 1) } @last_month = Date.today.last_month.end_of_month @two_months = Date.today.months_ago(2).end_of_month