scaffold models

This commit is contained in:
Min Zeya Phyo
2017-04-20 17:01:14 +06:30
parent 0a97947259
commit 0af7d78c3c
145 changed files with 4127 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
require 'rails_helper'
RSpec.describe "settings/menu_item_attributes/edit", type: :view do
before(:each) do
@settings_menu_item_attribute = assign(:settings_menu_item_attribute, Settings::MenuItemAttribute.create!(
:attribute_type => "MyString",
:name => "MyString",
:value => "MyString"
))
end
it "renders the edit settings_menu_item_attribute form" do
render
assert_select "form[action=?][method=?]", settings_menu_item_attribute_path(@settings_menu_item_attribute), "post" do
assert_select "input#settings_menu_item_attribute_attribute_type[name=?]", "settings_menu_item_attribute[attribute_type]"
assert_select "input#settings_menu_item_attribute_name[name=?]", "settings_menu_item_attribute[name]"
assert_select "input#settings_menu_item_attribute_value[name=?]", "settings_menu_item_attribute[value]"
end
end
end

View File

@@ -0,0 +1,25 @@
require 'rails_helper'
RSpec.describe "settings/menu_item_attributes/index", type: :view do
before(:each) do
assign(:settings_menu_item_attributes, [
Settings::MenuItemAttribute.create!(
:attribute_type => "Attribute Type",
:name => "Name",
:value => "Value"
),
Settings::MenuItemAttribute.create!(
:attribute_type => "Attribute Type",
:name => "Name",
:value => "Value"
)
])
end
it "renders a list of settings/menu_item_attributes" do
render
assert_select "tr>td", :text => "Attribute Type".to_s, :count => 2
assert_select "tr>td", :text => "Name".to_s, :count => 2
assert_select "tr>td", :text => "Value".to_s, :count => 2
end
end

View File

@@ -0,0 +1,24 @@
require 'rails_helper'
RSpec.describe "settings/menu_item_attributes/new", type: :view do
before(:each) do
assign(:settings_menu_item_attribute, Settings::MenuItemAttribute.new(
:attribute_type => "MyString",
:name => "MyString",
:value => "MyString"
))
end
it "renders new settings_menu_item_attribute form" do
render
assert_select "form[action=?][method=?]", settings_menu_item_attributes_path, "post" do
assert_select "input#settings_menu_item_attribute_attribute_type[name=?]", "settings_menu_item_attribute[attribute_type]"
assert_select "input#settings_menu_item_attribute_name[name=?]", "settings_menu_item_attribute[name]"
assert_select "input#settings_menu_item_attribute_value[name=?]", "settings_menu_item_attribute[value]"
end
end
end

View File

@@ -0,0 +1,18 @@
require 'rails_helper'
RSpec.describe "settings/menu_item_attributes/show", type: :view do
before(:each) do
@settings_menu_item_attribute = assign(:settings_menu_item_attribute, Settings::MenuItemAttribute.create!(
:attribute_type => "Attribute Type",
:name => "Name",
:value => "Value"
))
end
it "renders attributes in <p>" do
render
expect(rendered).to match(/Attribute Type/)
expect(rendered).to match(/Name/)
expect(rendered).to match(/Value/)
end
end