Files
sx-fc/spec/views/transactions/sales/new.html.erb_spec.rb
2017-10-23 11:38:10 +06:30

61 lines
1.8 KiB
Ruby
Executable File

require 'rails_helper'
RSpec.describe "transactions/sales/new", type: :view do
before(:each) do
assign(:transactions_sale, Transactions::Sale.new(
:cashier => nil,
:cashier_name => "MyString",
:requested_by => "MyString",
:receipt_no => "MyString",
:customer => nil,
:payment_status => "MyString",
:sale_status => "MyString",
:total_amount => "9.99",
:total_discount => "9.99",
:total_tax => "9.99",
:tax_type => "MyString",
:grand_total => "9.99",
:rounding_adjustment => "9.99",
:amount_received => "9.99",
:amount_changed => "9.99"
))
end
it "renders new transactions_sale form" do
render
assert_select "form[action=?][method=?]", transactions_sales_path, "post" do
assert_select "input[name=?]", "transactions_sale[cashier_id]"
assert_select "input[name=?]", "transactions_sale[cashier_name]"
assert_select "input[name=?]", "transactions_sale[requested_by]"
assert_select "input[name=?]", "transactions_sale[receipt_no]"
assert_select "input[name=?]", "transactions_sale[customer_id]"
assert_select "input[name=?]", "transactions_sale[payment_status]"
assert_select "input[name=?]", "transactions_sale[sale_status]"
assert_select "input[name=?]", "transactions_sale[total_amount]"
assert_select "input[name=?]", "transactions_sale[total_discount]"
assert_select "input[name=?]", "transactions_sale[total_tax]"
assert_select "input[name=?]", "transactions_sale[tax_type]"
assert_select "input[name=?]", "transactions_sale[grand_total]"
assert_select "input[name=?]", "transactions_sale[rounding_adjustment]"
assert_select "input[name=?]", "transactions_sale[amount_received]"
assert_select "input[name=?]", "transactions_sale[amount_changed]"
end
end
end