diff --git a/app/controllers/counter_notices_controller.rb b/app/controllers/counter_notices_controller.rb deleted file mode 100644 index ace20531b..000000000 --- a/app/controllers/counter_notices_controller.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CounterNoticesController < ApplicationController - def new - @counter_notice = CounterNotice.new - end - - def create - @counter_notice = CounterNotice.new(params[:counter_notice]) - if @counter_notice.valid? - render :show - end - end - - def show - @counter_notice = CounterNotice.new(params[:counter_notice]) - end - -end diff --git a/app/controllers/dmca_counter_notices_controller.rb b/app/controllers/dmca_counter_notices_controller.rb new file mode 100644 index 000000000..45c4cef9d --- /dev/null +++ b/app/controllers/dmca_counter_notices_controller.rb @@ -0,0 +1,17 @@ +class DMCACounterNoticesController < ApplicationController + def new + @dmca_counter_notice = DMCACounterNotice.new + end + + def create + @dmca_counter_notice = DMCACounterNotice.new(params[:dmca_counter_notice]) + + return unless @dmca_counter_notice.valid? + + render :show + end + + def show + @dmca_counter_notice = DMCACounterNotice.new(params[:dmca_counter_notice]) + end +end diff --git a/app/models/counter_notice.rb b/app/models/dmca_counter_notice.rb similarity index 98% rename from app/models/counter_notice.rb rename to app/models/dmca_counter_notice.rb index 11d2aaa2b..8c15ea1b3 100644 --- a/app/models/counter_notice.rb +++ b/app/models/dmca_counter_notice.rb @@ -1,4 +1,4 @@ -class CounterNotice +class DMCACounterNotice extend ActiveModel::Naming include ActiveModel::Conversion include ActiveModel::Validations @@ -48,5 +48,4 @@ def in_us? def persisted? false end - end diff --git a/app/views/counter_notices/_form.html.erb b/app/views/dmca_counter_notices/_form.html.erb similarity index 96% rename from app/views/counter_notices/_form.html.erb rename to app/views/dmca_counter_notices/_form.html.erb index 6e650b8bb..533b34c52 100644 --- a/app/views/counter_notices/_form.html.erb +++ b/app/views/dmca_counter_notices/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for(counter_notice) do |f| %> +<%= simple_form_for(dmca_counter_notice) do |f| %>

Please note that Lumen offers this counternotice generator form purely as a formatting convenience for users.

@@ -25,7 +25,7 @@ <%= f.input :jurisdiction, as: :radio_buttons, item_label_class: "collection_radio_buttons", - collection: CounterNotice::JURISDICTIONS + collection: DMCACounterNotice::JURISDICTIONS %> <%= f.input :consent_to_be_served, diff --git a/app/views/counter_notices/create.html.erb b/app/views/dmca_counter_notices/create.html.erb similarity index 72% rename from app/views/counter_notices/create.html.erb rename to app/views/dmca_counter_notices/create.html.erb index ba04f1bb5..f207ca704 100644 --- a/app/views/counter_notices/create.html.erb +++ b/app/views/dmca_counter_notices/create.html.erb @@ -5,6 +5,6 @@

Create a DMCA Counter-Notification

- <%= render "form", counter_notice: @counter_notice %> + <%= render "form", dmca_counter_notice: @dmca_counter_notice %>
diff --git a/app/views/counter_notices/new.html.erb b/app/views/dmca_counter_notices/new.html.erb similarity index 72% rename from app/views/counter_notices/new.html.erb rename to app/views/dmca_counter_notices/new.html.erb index ba04f1bb5..f207ca704 100644 --- a/app/views/counter_notices/new.html.erb +++ b/app/views/dmca_counter_notices/new.html.erb @@ -5,6 +5,6 @@

Create a DMCA Counter-Notification

- <%= render "form", counter_notice: @counter_notice %> + <%= render "form", dmca_counter_notice: @dmca_counter_notice %> diff --git a/app/views/counter_notices/show.html.erb b/app/views/dmca_counter_notices/show.html.erb similarity index 72% rename from app/views/counter_notices/show.html.erb rename to app/views/dmca_counter_notices/show.html.erb index 6cc2d8bdd..8648bafcc 100644 --- a/app/views/counter_notices/show.html.erb +++ b/app/views/dmca_counter_notices/show.html.erb @@ -3,19 +3,19 @@

- <%= @counter_notice.service_provider_name %>
- <%= @counter_notice.service_provider_address_line_1 %>
- <%= @counter_notice.service_provider_address_line_2 %>
- <%= @counter_notice.service_provider_address_line_3 %>
- <%= @counter_notice.service_provider_address_line_4 %>
- <%= @counter_notice.service_provider_phone %>
+ <%= @dmca_counter_notice.service_provider_name %>
+ <%= @dmca_counter_notice.service_provider_address_line_1 %>
+ <%= @dmca_counter_notice.service_provider_address_line_2 %>
+ <%= @dmca_counter_notice.service_provider_address_line_3 %>
+ <%= @dmca_counter_notice.service_provider_address_line_4 %>
+ <%= @dmca_counter_notice.service_provider_phone %>

<%= l(Date.today, format: :friendly_date) %>

RE: Mistaken Removal -

Dear <%= @counter_notice.service_provider_name %>;

+

Dear <%= @dmca_counter_notice.service_provider_name %>;

Please find attached to this letter a list of material removed by you pursuant to 17 U.S.C. Section 512. I have a good faith belief that this @@ -23,7 +23,7 @@ misidentification of the material. I declare that this is true and accurate under penalty of perjury under the laws of the United States of America.

- <% if @counter_notice.in_us? %> + <% if @dmca_counter_notice.in_us? %>

For the purposes of this matter, I consent to the jurisdiction of the Federal District Court for the judicial district in which I reside. @@ -57,12 +57,12 @@


-

<%= @counter_notice.your_name %>
- <%= @counter_notice.your_phone %>
- <%= @counter_notice.your_address_line_1 %>
- <%= @counter_notice.your_address_line_2 %>
- <%= @counter_notice.your_address_line_3 %>
- <%= @counter_notice.your_address_line_4 %>
+

<%= @dmca_counter_notice.your_name %>
+ <%= @dmca_counter_notice.your_phone %>
+ <%= @dmca_counter_notice.your_address_line_1 %>
+ <%= @dmca_counter_notice.your_address_line_2 %>
+ <%= @dmca_counter_notice.your_address_line_3 %>
+ <%= @dmca_counter_notice.your_address_line_4 %>

Enclosure

diff --git a/app/views/notices/select_type.html.erb b/app/views/notices/select_type.html.erb index 1f3a9b668..86f8b396d 100644 --- a/app/views/notices/select_type.html.erb +++ b/app/views/notices/select_type.html.erb @@ -32,7 +32,7 @@ <%= link_to( "Create DMCA Counter Notice", - new_counter_notice_path, + new_dmca_counter_notice_path, class: "button" ) %> diff --git a/app/views/notices/show.html.erb b/app/views/notices/show.html.erb index cb9a82bba..1ebdfec0e 100644 --- a/app/views/notices/show.html.erb +++ b/app/views/notices/show.html.erb @@ -128,7 +128,7 @@ <%= link_to( "Create DMCA Counter Notice", - new_counter_notice_path, + new_dmca_counter_notice_path, class: "button" ) %> diff --git a/app/views/shared/_navigation.html.erb b/app/views/shared/_navigation.html.erb index abfdc405d..3f20744e3 100644 --- a/app/views/shared/_navigation.html.erb +++ b/app/views/shared/_navigation.html.erb @@ -24,7 +24,7 @@ <%= link_to( "Create DMCA Counter Notice", - new_counter_notice_path + new_dmca_counter_notice_path ) %> diff --git a/config/routes.rb b/config/routes.rb index aab99112b..fa1435567 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,7 +18,7 @@ end end - resources :counter_notices, only: %i[new create] + resources :dmca_counter_notices, only: %i[new create] namespace :entities do resources :search, only: [:index] diff --git a/spec/factories.rb b/spec/factories.rb index 134caab1d..3af8e3f30 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -272,7 +272,7 @@ name 'test_role' end - factory :counter_notice do + factory :dmca_counter_notice do attach_list_of_works true list_removed_in_error true perjury_risk_acknowledged true diff --git a/spec/integration/user_submits_dmca_counternotice_spec.rb b/spec/integration/user_submits_dmca_counternotice_spec.rb index 2f289a86a..e5b9f5e56 100644 --- a/spec/integration/user_submits_dmca_counternotice_spec.rb +++ b/spec/integration/user_submits_dmca_counternotice_spec.rb @@ -3,7 +3,7 @@ feature "DMCA counter notices" do scenario "A user submits a DMCA counter notice" do - counternotice = CounterNoticeOnPage.new + counternotice = DMCACounterNoticeOnPage.new counternotice.visit_counter_notice_page diff --git a/spec/models/counter_notice_spec.rb b/spec/models/dmca_counter_notice_spec.rb similarity index 77% rename from spec/models/counter_notice_spec.rb rename to spec/models/dmca_counter_notice_spec.rb index 826a31809..9878f1da0 100644 --- a/spec/models/counter_notice_spec.rb +++ b/spec/models/dmca_counter_notice_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe CounterNotice, type: :model do +RSpec.describe DMCACounterNotice, type: :model do it { is_expected.to validate_presence_of :attach_list_of_works } it { is_expected.to validate_presence_of :list_removed_in_error } it { is_expected.to validate_presence_of :perjury_risk_acknowledged } @@ -9,16 +9,15 @@ context "jurisdictions" do it "knows when it's in the US" do - counter_notice = build(:counter_notice, :in_us) + counter_notice = build(:dmca_counter_notice, :in_us) expect(counter_notice.in_us?).to be_truthy end it "knows when it's outside the US" do - counter_notice = build(:counter_notice, :outside_us) + counter_notice = build(:dmca_counter_notice, :outside_us) expect(counter_notice.in_us?).to be_falsey end end - end diff --git a/spec/support/page_objects/counter_notice_on_page.rb b/spec/support/page_objects/dmca_counter_notice_on_page.rb similarity index 87% rename from spec/support/page_objects/counter_notice_on_page.rb rename to spec/support/page_objects/dmca_counter_notice_on_page.rb index 8da4c1302..67bbd4c4c 100644 --- a/spec/support/page_objects/counter_notice_on_page.rb +++ b/spec/support/page_objects/dmca_counter_notice_on_page.rb @@ -1,13 +1,13 @@ require_relative '../page_object' -class CounterNoticeOnPage < PageObject +class DMCACounterNoticeOnPage < PageObject def choose_radio_option(option) choose(option) end def visit_counter_notice_page - visit '/counter_notices/new' + visit '/dmca_counter_notices/new' end def fill_in_user_form_with(attributes)