Network and first signature collection prototyping
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "network/signature_collections/edit", type: :view do
|
||||
before(:each) do
|
||||
@network_signature_collection = assign(:network_signature_collection, Network::SignatureCollection.create!(
|
||||
:location_name => "MyString",
|
||||
:location_zip => 1,
|
||||
:location_address => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit network_signature_collection form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", network_signature_collection_path(@network_signature_collection), "post" do
|
||||
|
||||
assert_select "input#network_signature_collection_location_name[name=?]", "network_signature_collection[location_name]"
|
||||
|
||||
assert_select "input#network_signature_collection_location_zip[name=?]", "network_signature_collection[location_zip]"
|
||||
|
||||
assert_select "input#network_signature_collection_location_address[name=?]", "network_signature_collection[location_address]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,25 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "network/signature_collections/index", type: :view do
|
||||
before(:each) do
|
||||
assign(:network_signature_collections, [
|
||||
Network::SignatureCollection.create!(
|
||||
:location_name => "Location Name",
|
||||
:location_zip => 2,
|
||||
:location_address => "Location Address"
|
||||
),
|
||||
Network::SignatureCollection.create!(
|
||||
:location_name => "Location Name",
|
||||
:location_zip => 2,
|
||||
:location_address => "Location Address"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of network/signature_collections" do
|
||||
render
|
||||
assert_select "tr>td", :text => "Location Name".to_s, :count => 2
|
||||
assert_select "tr>td", :text => 2.to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Location Address".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "network/signature_collections/new", type: :view do
|
||||
before(:each) do
|
||||
assign(:network_signature_collection, Network::SignatureCollection.new(
|
||||
:location_name => "MyString",
|
||||
:location_zip => 1,
|
||||
:location_address => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders new network_signature_collection form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", network_signature_collections_path, "post" do
|
||||
|
||||
assert_select "input#network_signature_collection_location_name[name=?]", "network_signature_collection[location_name]"
|
||||
|
||||
assert_select "input#network_signature_collection_location_zip[name=?]", "network_signature_collection[location_zip]"
|
||||
|
||||
assert_select "input#network_signature_collection_location_address[name=?]", "network_signature_collection[location_address]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,18 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "network/signature_collections/show", type: :view do
|
||||
before(:each) do
|
||||
@network_signature_collection = assign(:network_signature_collection, Network::SignatureCollection.create!(
|
||||
:location_name => "Location Name",
|
||||
:location_zip => 2,
|
||||
:location_address => "Location Address"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
expect(rendered).to match(/Location Name/)
|
||||
expect(rendered).to match(/2/)
|
||||
expect(rendered).to match(/Location Address/)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user