require 'rails_helper'

RSpec.describe "membership_actions/index", type: :view do
  before(:each) do
    assign(:membership_actions, [
      MembershipAction.create!(
        :membership_type => "Membership Type",
        :is_active => false,
        :gateway_communication_type => "Gateway Communication Type",
        :gateway_url => "Gateway Url",
        :auth_token => "Auth Token",
        :merchant_account_id => "Merchant Account",
        :created_by => "Created By",
        :additional_parameter => ""
      ),
      MembershipAction.create!(
        :membership_type => "Membership Type",
        :is_active => false,
        :gateway_communication_type => "Gateway Communication Type",
        :gateway_url => "Gateway Url",
        :auth_token => "Auth Token",
        :merchant_account_id => "Merchant Account",
        :created_by => "Created By",
        :additional_parameter => ""
      )
    ])
  end

  it "renders a list of membership_actions" do
    render
    assert_select "tr>td", :text => "Membership Type".to_s, :count => 2
    assert_select "tr>td", :text => false.to_s, :count => 2
    assert_select "tr>td", :text => "Gateway Communication Type".to_s, :count => 2
    assert_select "tr>td", :text => "Gateway Url".to_s, :count => 2
    assert_select "tr>td", :text => "Auth Token".to_s, :count => 2
    assert_select "tr>td", :text => "Merchant Account".to_s, :count => 2
    assert_select "tr>td", :text => "Created By".to_s, :count => 2
    assert_select "tr>td", :text => "".to_s, :count => 2
  end
end
