queue and crm view updated
This commit is contained in:
24
spec/views/crm/dining_queues/edit.html.erb_spec.rb
Normal file
24
spec/views/crm/dining_queues/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "crm/dining_queues/edit", type: :view do
|
||||
before(:each) do
|
||||
@crm_dining_queue = assign(:crm_dining_queue, Crm::DiningQueue.create!(
|
||||
:name => "MyString",
|
||||
:contact => "MyString",
|
||||
:queue_no => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit crm_dining_queue form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", crm_dining_queue_path(@crm_dining_queue), "post" do
|
||||
|
||||
assert_select "input[name=?]", "crm_dining_queue[name]"
|
||||
|
||||
assert_select "input[name=?]", "crm_dining_queue[contact]"
|
||||
|
||||
assert_select "input[name=?]", "crm_dining_queue[queue_no]"
|
||||
end
|
||||
end
|
||||
end
|
||||
25
spec/views/crm/dining_queues/index.html.erb_spec.rb
Normal file
25
spec/views/crm/dining_queues/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "crm/dining_queues/index", type: :view do
|
||||
before(:each) do
|
||||
assign(:crm_dining_queues, [
|
||||
Crm::DiningQueue.create!(
|
||||
:name => "Name",
|
||||
:contact => "Contact",
|
||||
:queue_no => "Queue No"
|
||||
),
|
||||
Crm::DiningQueue.create!(
|
||||
:name => "Name",
|
||||
:contact => "Contact",
|
||||
:queue_no => "Queue No"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of crm/dining_queues" do
|
||||
render
|
||||
assert_select "tr>td", :text => "Name".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Contact".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Queue No".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
24
spec/views/crm/dining_queues/new.html.erb_spec.rb
Normal file
24
spec/views/crm/dining_queues/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "crm/dining_queues/new", type: :view do
|
||||
before(:each) do
|
||||
assign(:crm_dining_queue, Crm::DiningQueue.new(
|
||||
:name => "MyString",
|
||||
:contact => "MyString",
|
||||
:queue_no => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders new crm_dining_queue form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", crm_dining_queues_path, "post" do
|
||||
|
||||
assert_select "input[name=?]", "crm_dining_queue[name]"
|
||||
|
||||
assert_select "input[name=?]", "crm_dining_queue[contact]"
|
||||
|
||||
assert_select "input[name=?]", "crm_dining_queue[queue_no]"
|
||||
end
|
||||
end
|
||||
end
|
||||
18
spec/views/crm/dining_queues/show.html.erb_spec.rb
Normal file
18
spec/views/crm/dining_queues/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "crm/dining_queues/show", type: :view do
|
||||
before(:each) do
|
||||
@crm_dining_queue = assign(:crm_dining_queue, Crm::DiningQueue.create!(
|
||||
:name => "Name",
|
||||
:contact => "Contact",
|
||||
:queue_no => "Queue No"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
expect(rendered).to match(/Name/)
|
||||
expect(rendered).to match(/Contact/)
|
||||
expect(rendered).to match(/Queue No/)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user