Skip to content

Commit

Permalink
0.256.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwoldatwork authored Aug 16, 2023
2 parents 834c369 + e7b487e commit 95e5233
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 71 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
version: 2.1
orbs:
browser-tools: circleci/[email protected].2
browser-tools: circleci/[email protected].3

jobs:
build:
Expand Down Expand Up @@ -50,8 +50,8 @@ jobs:
- run:
name: Setup Chrome
command: |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
wget https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.198-1_amd64.deb
sudo apt install ./google-chrome-stable_114.0.5735.198-1_amd64.deb
# run tests!
- run:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ group :test do
gem 'factory_bot_rails'
gem 'rails-controller-testing'
gem 'rspec-rails', '>=6.0.3'
gem 'selenium-webdriver', ">=4.10.0"
gem 'selenium-webdriver'
gem 'simplecov', require: false
gem 'webdrivers', '>= 5.1.0'
end
122 changes: 61 additions & 61 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,47 @@ GEM
aasm-diagram (0.1.3)
aasm (~> 5.0, >= 4.12)
ruby-graphviz (~> 1.2)
actioncable (7.0.6)
actionpack (= 7.0.6)
activesupport (= 7.0.6)
actioncable (7.0.7)
actionpack (= 7.0.7)
activesupport (= 7.0.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.6)
actionpack (= 7.0.6)
activejob (= 7.0.6)
activerecord (= 7.0.6)
activestorage (= 7.0.6)
activesupport (= 7.0.6)
actionmailbox (7.0.7)
actionpack (= 7.0.7)
activejob (= 7.0.7)
activerecord (= 7.0.7)
activestorage (= 7.0.7)
activesupport (= 7.0.7)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.6)
actionpack (= 7.0.6)
actionview (= 7.0.6)
activejob (= 7.0.6)
activesupport (= 7.0.6)
actionmailer (7.0.7)
actionpack (= 7.0.7)
actionview (= 7.0.7)
activejob (= 7.0.7)
activesupport (= 7.0.7)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.6)
actionview (= 7.0.6)
activesupport (= 7.0.6)
actionpack (7.0.7)
actionview (= 7.0.7)
activesupport (= 7.0.7)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.6)
actionpack (= 7.0.6)
activerecord (= 7.0.6)
activestorage (= 7.0.6)
activesupport (= 7.0.6)
actiontext (7.0.7)
actionpack (= 7.0.7)
activerecord (= 7.0.7)
activestorage (= 7.0.7)
activesupport (= 7.0.7)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.6)
activesupport (= 7.0.6)
actionview (7.0.7)
activesupport (= 7.0.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
Expand All @@ -68,22 +68,22 @@ GEM
activemodel (>= 4.1, < 7.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (7.0.6)
activesupport (= 7.0.6)
activejob (7.0.7)
activesupport (= 7.0.7)
globalid (>= 0.3.6)
activemodel (7.0.6)
activesupport (= 7.0.6)
activerecord (7.0.6)
activemodel (= 7.0.6)
activesupport (= 7.0.6)
activestorage (7.0.6)
actionpack (= 7.0.6)
activejob (= 7.0.6)
activerecord (= 7.0.6)
activesupport (= 7.0.6)
activemodel (7.0.7)
activesupport (= 7.0.7)
activerecord (7.0.7)
activemodel (= 7.0.7)
activesupport (= 7.0.7)
activestorage (7.0.7)
actionpack (= 7.0.7)
activejob (= 7.0.7)
activerecord (= 7.0.7)
activesupport (= 7.0.7)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.6)
activesupport (7.0.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand All @@ -96,10 +96,10 @@ GEM
aes_key_wrap (1.1.0)
ast (2.4.2)
aws-eventstream (1.2.0)
aws-partitions (1.800.0)
aws-partitions (1.805.0)
aws-record (2.11.0)
aws-sdk-dynamodb (~> 1, >= 1.85.0)
aws-sdk-core (3.180.2)
aws-sdk-core (3.180.3)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
Expand All @@ -115,7 +115,7 @@ GEM
aws-sessionstore-dynamodb (~> 2)
concurrent-ruby (~> 1)
railties (>= 5.2.0)
aws-sdk-ses (1.54.0)
aws-sdk-ses (1.55.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sigv4 (~> 1.1)
aws-sdk-sesv2 (1.38.0)
Expand Down Expand Up @@ -277,7 +277,7 @@ GEM
method_source (1.0.0)
mime-types (3.5.0)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0218.1)
mime-types-data (3.2023.0808)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
Expand All @@ -297,10 +297,10 @@ GEM
net-protocol
newrelic_rpm (9.3.1)
nio4r (2.5.9)
nokogiri (1.15.3)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.15.3-x86_64-darwin)
nokogiri (1.15.4-x86_64-darwin)
racc (~> 1.4)
oauth2 (2.0.9)
faraday (>= 0.17.3, < 3.0)
Expand Down Expand Up @@ -342,20 +342,20 @@ GEM
rack (~> 2.2, >= 2.2.4)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.6)
actioncable (= 7.0.6)
actionmailbox (= 7.0.6)
actionmailer (= 7.0.6)
actionpack (= 7.0.6)
actiontext (= 7.0.6)
actionview (= 7.0.6)
activejob (= 7.0.6)
activemodel (= 7.0.6)
activerecord (= 7.0.6)
activestorage (= 7.0.6)
activesupport (= 7.0.6)
rails (7.0.7)
actioncable (= 7.0.7)
actionmailbox (= 7.0.7)
actionmailer (= 7.0.7)
actionpack (= 7.0.7)
actiontext (= 7.0.7)
actionview (= 7.0.7)
activejob (= 7.0.7)
activemodel (= 7.0.7)
activerecord (= 7.0.7)
activestorage (= 7.0.7)
activesupport (= 7.0.7)
bundler (>= 1.15.0)
railties (= 7.0.6)
railties (= 7.0.7)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -372,9 +372,9 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.6)
actionpack (= 7.0.6)
activesupport (= 7.0.6)
railties (7.0.7)
actionpack (= 7.0.7)
activesupport (= 7.0.7)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down Expand Up @@ -436,7 +436,7 @@ GEM
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-rspec (2.23.0)
rubocop-rspec (2.23.2)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
Expand Down Expand Up @@ -570,7 +570,7 @@ DEPENDENCIES
rubocop-rails
rubocop-rspec
sass-rails (>= 6.0.0)
selenium-webdriver (>= 4.10.0)
selenium-webdriver
sidekiq
simplecov
sprockets-rails
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/cscrm_data_collections2_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def index
if cscrm_manager_permissions?
@cscrm_data_collections = CscrmDataCollection2.all.includes(:organization)
else
@cscrm_data_collections = current_user.organization.cscrm_data_collections.all.includes(:organization)
@cscrm_data_collections = current_user.organization.cscrm_data_collections2.all.includes(:organization)
end
}
format.csv {
Expand Down Expand Up @@ -71,7 +71,7 @@ def update
def submit
@cscrm_data_collection.submit!
Event.log_event(Event.names[:cscrm_data_collection_collection_submitted], 'CSRCM Data Collection', @cscrm_data_collection.id, "CSRCM Data Collection #{@cscrm_data_collection.id} submitted at #{DateTime.now}", current_user.id)
UserMailer.cscrm_data_collection_notification(collection_id: @cscrm_data_collection.id).deliver_later
UserMailer.cscrm_data_collection2_notification(collection_id: @cscrm_data_collection.id).deliver_later
redirect_to admin_cscrm_data_collections2_path(@cscrm_data_collection), notice: 'CSRCM Data Collection has been submitted successfully.'
end

Expand All @@ -94,7 +94,7 @@ def destroy
Event.log_event(Event.names[:cscrm_data_collection_collection_deleted], 'CSRCM Data Collection', @cscrm_data_collection.id, "CSRCM Data Collection #{@cscrm_data_collection.id} deleted at #{DateTime.now}", current_user.id)

respond_to do |format|
format.html { redirect_to admin_cscrm_data_collections_url, notice: 'Cscrm data collection was successfully destroyed.' }
format.html { redirect_to admin_cscrm_data_collections2_index_url, notice: 'Cscrm data collection was successfully destroyed.' }
format.json { head :no_content }
end
end
Expand Down
11 changes: 9 additions & 2 deletions app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,21 @@ def collection_notification(collection_id:)
mail subject: "Data Collection notification to #{@collection.name}",
to: (ENV.fetch('TOUCHPOINTS_ADMIN_EMAILS').split(',') + User.performance_managers.collect(&:email)).uniq
end

def cscrm_data_collection_notification(collection_id:)
set_logo
@collection = CscrmDataCollection.find(collection_id)
mail subject: "CSCRM Data Collection notification to #{@collection.id}",
to: (ENV.fetch('TOUCHPOINTS_ADMIN_EMAILS').split(',') + User.where(cscrm_data_collection_manager: true).collect(&:email)).uniq
end

def cscrm_data_collection2_notification(collection_id:)
set_logo
@collection = CscrmDataCollection2.find(collection_id)
mail subject: "CSCRM Data Collection 2 notification to #{@collection.id}",
to: (ENV.fetch('TOUCHPOINTS_ADMIN_EMAILS').split(',') + User.where(cscrm_data_collection_manager: true).collect(&:email)).uniq
end

def quarterly_performance_notification(collection_id:)
set_logo
@collection = Collection.find(collection_id)
Expand Down Expand Up @@ -131,7 +138,7 @@ def website_data_collection(email, websites)
@websites = websites
mail subject: 'Website Data Collection Request', to: email
end

def website_backlog_data_collection(email, websites)
return unless email

Expand Down
15 changes: 15 additions & 0 deletions app/views/user_mailer/cscrm_data_collection2_notification.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<%= render 'user_mailer/components/header' %>
<h3>
CSCRM Data Collection Notification
</h3>
<p>
Updates to the CSCRM Data Collection,
<%= @collection.id %>
have occurred.
</p>
<p>
Visit
<a href="<%= admin_cscrm_data_collections2_url(@collection) %>">
<%= admin_cscrm_data_collections2_url(@collection) %>
</a> to view.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Touchpoints.gov CSCRM Data Collection 2 Notification

Updates to the CSCRM Data Collection 2, <%= @collection.id %> have occurred.

Visit <%= admin_cscrm_data_collections2_index_url(@collection) %> to view.
8 changes: 8 additions & 0 deletions spec/factories/cscrm_data_collection2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

FactoryBot.define do
factory :cscrm_data_collection2 do
year { 2023 }
quarter { 4 }
end
end
24 changes: 23 additions & 1 deletion spec/mailers/user_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
expect(mail.body.encoded).to match('Quarterly Performance Notification')
end
end

describe 'CSCRM Data Collection' do
let!(:organization) { FactoryBot.create(:organization) }
let!(:user) { FactoryBot.create(:user, organization:) }
Expand All @@ -111,6 +111,28 @@
end
end

describe 'CSCRM Data Collection 2' do
let!(:organization) { FactoryBot.create(:organization) }
let!(:user) { FactoryBot.create(:user, organization:) }
let!(:cscrm_data_manager) { FactoryBot.create(:user, organization:, cscrm_data_collection_manager: true) }
let!(:cscrm_data_collection2) { FactoryBot.create(:cscrm_data_collection2, organization:, user:) }
let(:mail) { UserMailer.cscrm_data_collection2_notification(collection_id: cscrm_data_collection2.id) }

before do
ENV['ENABLE_EMAIL_NOTIFICATIONS'] = 'true'
end

it 'renders the headers' do
expect(mail.subject).to eq("CSCRM Data Collection 2 notification to #{cscrm_data_collection2.id}")
expect(mail.to).to eq([ENV.fetch('TOUCHPOINTS_ADMIN_EMAILS'), cscrm_data_manager.email])
expect(mail.from).to eq([ENV.fetch('TOUCHPOINTS_EMAIL_SENDER')])
end

it 'renders the body' do
expect(mail.body.encoded).to match('CSCRM Data Collection 2 Notification')
end
end

describe 'account_deactivation_scheduled_notification' do
let!(:organization) { FactoryBot.create(:organization) }
let(:user) { FactoryBot.create(:user, organization:) }
Expand Down

0 comments on commit 95e5233

Please sign in to comment.