require 'rails_helper'

RSpec.describe "settings/membership_settings/new", type: :view do
  before(:each) do
    assign(:settings_membership_setting, Settings::MembershipSetting.new(
      :membership_type => "MyString",
      :is_active => false,
      :gateway_communication_type => "MyString",
      :gateway_url => "MyString",
      :auth_token => "MyString",
      :merchant_account => nil,
      :created_by => "MyString"
    ))
  end

  it "renders new settings_membership_setting form" do
    render

    assert_select "form[action=?][method=?]", settings_membership_settings_path, "post" do

      assert_select "input#settings_membership_setting_membership_type[name=?]", "settings_membership_setting[membership_type]"

      assert_select "input#settings_membership_setting_is_active[name=?]", "settings_membership_setting[is_active]"

      assert_select "input#settings_membership_setting_gateway_communication_type[name=?]", "settings_membership_setting[gateway_communication_type]"

      assert_select "input#settings_membership_setting_gateway_url[name=?]", "settings_membership_setting[gateway_url]"

      assert_select "input#settings_membership_setting_auth_token[name=?]", "settings_membership_setting[auth_token]"

      assert_select "input#settings_membership_setting_merchant_account_id[name=?]", "settings_membership_setting[merchant_account_id]"

      assert_select "input#settings_membership_setting_created_by[name=?]", "settings_membership_setting[created_by]"
    end
  end
end
