Skip to content

Commit

Permalink
Merge e3299e9 into bcba9a4
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-hank committed Nov 20, 2018
2 parents bcba9a4 + e3299e9 commit 5290c73
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 49 deletions.
17 changes: 0 additions & 17 deletions app/controllers/counter_notices_controller.rb

This file was deleted.

17 changes: 17 additions & 0 deletions app/controllers/dmca_counter_notices_controller.rb
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CounterNotice
class DMCACounterNotice
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
Expand Down Expand Up @@ -48,5 +48,4 @@ def in_us?
def persisted?
false
end

end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= simple_form_for(counter_notice) do |f| %>
<%= simple_form_for(dmca_counter_notice) do |f| %>

<section class="important-terms">
<p>Please note that Lumen offers this counternotice generator form purely as a formatting convenience for users.</p>
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<h3 class="title">Create a DMCA Counter-Notification</h3>
</header>

<%= render "form", counter_notice: @counter_notice %>
<%= render "form", dmca_counter_notice: @dmca_counter_notice %>

</section>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<h3 class="title">Create a DMCA Counter-Notification</h3>
</header>

<%= render "form", counter_notice: @counter_notice %>
<%= render "form", dmca_counter_notice: @dmca_counter_notice %>

</section>
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
<section class="counter-notice">
<article class="counter-notice-show">
<p>
<%= @counter_notice.service_provider_name %><br/>
<%= @counter_notice.service_provider_address_line_1 %><br/>
<%= @counter_notice.service_provider_address_line_2 %><br/>
<%= @counter_notice.service_provider_address_line_3 %><br/>
<%= @counter_notice.service_provider_address_line_4 %><br/>
<%= @counter_notice.service_provider_phone %><br/>
<%= @dmca_counter_notice.service_provider_name %><br/>
<%= @dmca_counter_notice.service_provider_address_line_1 %><br/>
<%= @dmca_counter_notice.service_provider_address_line_2 %><br/>
<%= @dmca_counter_notice.service_provider_address_line_3 %><br/>
<%= @dmca_counter_notice.service_provider_address_line_4 %><br/>
<%= @dmca_counter_notice.service_provider_phone %><br/>
</p>

<p class="date"><%= l(Date.today, format: :friendly_date) %></p>

<p><strong>RE: Mistaken Removal</strong>

<p>Dear <%= @counter_notice.service_provider_name %>;</p>
<p>Dear <%= @dmca_counter_notice.service_provider_name %>;</p>

<p> 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
material was removed or disabled in error as a result of mistake or
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.</p>

<% if @counter_notice.in_us? %>
<% if @dmca_counter_notice.in_us? %>
<p>For the purposes of this matter, I consent to the jurisdiction of the
Federal District Court for the judicial district in which I reside.

Expand Down Expand Up @@ -57,12 +57,12 @@

<hr class="signature-line"/>

<p><%= @counter_notice.your_name %><br />
<%= @counter_notice.your_phone %><br />
<%= @counter_notice.your_address_line_1 %><br />
<%= @counter_notice.your_address_line_2 %><br />
<%= @counter_notice.your_address_line_3 %><br />
<%= @counter_notice.your_address_line_4 %><br />
<p><%= @dmca_counter_notice.your_name %><br />
<%= @dmca_counter_notice.your_phone %><br />
<%= @dmca_counter_notice.your_address_line_1 %><br />
<%= @dmca_counter_notice.your_address_line_2 %><br />
<%= @dmca_counter_notice.your_address_line_3 %><br />
<%= @dmca_counter_notice.your_address_line_4 %><br />
</p>
<p>Enclosure</p>
</article>
Expand Down
2 changes: 1 addition & 1 deletion app/views/notices/select_type.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<%=
link_to(
"Create DMCA Counter Notice",
new_counter_notice_path,
new_dmca_counter_notice_path,
class: "button"
)
%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/notices/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<%=
link_to(
"Create DMCA Counter Notice",
new_counter_notice_path,
new_dmca_counter_notice_path,
class: "button"
)
%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_navigation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<%=
link_to(
"Create DMCA Counter Notice",
new_counter_notice_path
new_dmca_counter_notice_path
)
%>
</li>
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion spec/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/user_submits_dmca_counternotice_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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 }
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 5290c73

Please sign in to comment.