account working
This commit is contained in:
21
spec/views/settings/accounts/edit.html.erb_spec.rb
Normal file
21
spec/views/settings/accounts/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/accounts/edit", type: :view do
|
||||
before(:each) do
|
||||
@settings_account = assign(:settings_account, Settings::Account.create!(
|
||||
:title => "MyString",
|
||||
:account_type => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit settings_account form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_account_path(@settings_account), "post" do
|
||||
|
||||
assert_select "input[name=?]", "settings_account[title]"
|
||||
|
||||
assert_select "input[name=?]", "settings_account[account_type]"
|
||||
end
|
||||
end
|
||||
end
|
||||
22
spec/views/settings/accounts/index.html.erb_spec.rb
Normal file
22
spec/views/settings/accounts/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/accounts/index", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_accounts, [
|
||||
Settings::Account.create!(
|
||||
:title => "Title",
|
||||
:account_type => "Account Type"
|
||||
),
|
||||
Settings::Account.create!(
|
||||
:title => "Title",
|
||||
:account_type => "Account Type"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of settings/accounts" do
|
||||
render
|
||||
assert_select "tr>td", :text => "Title".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Account Type".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
21
spec/views/settings/accounts/new.html.erb_spec.rb
Normal file
21
spec/views/settings/accounts/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/accounts/new", type: :view do
|
||||
before(:each) do
|
||||
assign(:settings_account, Settings::Account.new(
|
||||
:title => "MyString",
|
||||
:account_type => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders new settings_account form" do
|
||||
render
|
||||
|
||||
assert_select "form[action=?][method=?]", settings_accounts_path, "post" do
|
||||
|
||||
assert_select "input[name=?]", "settings_account[title]"
|
||||
|
||||
assert_select "input[name=?]", "settings_account[account_type]"
|
||||
end
|
||||
end
|
||||
end
|
||||
16
spec/views/settings/accounts/show.html.erb_spec.rb
Normal file
16
spec/views/settings/accounts/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe "settings/accounts/show", type: :view do
|
||||
before(:each) do
|
||||
@settings_account = assign(:settings_account, Settings::Account.create!(
|
||||
:title => "Title",
|
||||
:account_type => "Account Type"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
expect(rendered).to match(/Title/)
|
||||
expect(rendered).to match(/Account Type/)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user