index.html.erb_spec.rb 3.27 KB
# Author - Igor Portela - igorportela.com | Copyright(c) 2013. All rights reserved.
require 'spec_helper'

describe "wikivideos/index" do
  before(:each) do
    assign(:wikivideos, [
      stub_model(Wikivideo,
        :signal_name => "Signal Name",
        :movement_type => "Movement Type",
        :amount_of_hands => "Amount Of Hands",
        :facial_expression => "Facial Expression",
        :repeat_flag_primary => "Repeat Flag Primary",
        :primary_configuration_fingers => "Primary Configuration Fingers",
        :primary_orientation_of_hands => "Primary Orientation Of Hands",
        :subdivision_of_articulation_primary => "Subdivision Of Articulation Primary",
        :localization_of_articulation_primary => "Localization Of Articulation Primary",
        :time_spent => "",
        :user_id => nil
      ),
      stub_model(Wikivideo,
        :signal_name => "Signal Name",
        :movement_type => "Movement Type",
        :amount_of_hands => "Amount Of Hands",
        :facial_expression => "Facial Expression",
        :repeat_flag_primary => "Repeat Flag Primary",
        :primary_configuration_fingers => "Primary Configuration Fingers",
        :primary_orientation_of_hands => "Primary Orientation Of Hands",
        :subdivision_of_articulation_primary => "Subdivision Of Articulation Primary",
        :localization_of_articulation_primary => "Localization Of Articulation Primary",
        :time_spent => "",
        :user_id => nil
      )
    ])
  end

  it "renders a list of wikivideos" do
    render
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => "Signal Name".to_s, :count => 2
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => "Movement Type".to_s, :count => 2
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => "Amount Of Hands".to_s, :count => 2
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => "Facial Expression".to_s, :count => 2
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => "Repeat Flag Primary".to_s, :count => 2
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => "Primary Configuration Fingers".to_s, :count => 2
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => "Primary Orientation Of Hands".to_s, :count => 2
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => "Subdivision Of Articulation Primary".to_s, :count => 2
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => "Localization Of Articulation Primary".to_s, :count => 2
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => "".to_s, :count => 2
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td", :text => nil.to_s, :count => 2
  end
end