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

describe "wikivideos/new" do
  before(:each) do
    assign(:wikivideo, stub_model(Wikivideo,
      :signal_name => "MyString",
      :movement_type => "MyString",
      :amount_of_hands => "MyString",
      :facial_expression => "MyString",
      :repeat_flag_primary => "MyString",
      :primary_configuration_fingers => "MyString",
      :primary_orientation_of_hands => "MyString",
      :subdivision_of_articulation_primary => "MyString",
      :localization_of_articulation_primary => "MyString",
      :time_spent => "",
      :user_id => nil
    ).as_new_record)
  end

  it "renders new wikivideo form" do
    render

    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "form", :action => wikivideos_path, :method => "post" do
      assert_select "input#wikivideo_signal_name", :name => "wikivideo[signal_name]"
      assert_select "input#wikivideo_movement_type", :name => "wikivideo[movement_type]"
      assert_select "input#wikivideo_amount_of_hands", :name => "wikivideo[amount_of_hands]"
      assert_select "input#wikivideo_facial_expression", :name => "wikivideo[facial_expression]"
      assert_select "input#wikivideo_repeat_flag_primary", :name => "wikivideo[repeat_flag_primary]"
      assert_select "input#wikivideo_primary_configuration_fingers", :name => "wikivideo[primary_configuration_fingers]"
      assert_select "input#wikivideo_primary_orientation_of_hands", :name => "wikivideo[primary_orientation_of_hands]"
      assert_select "input#wikivideo_subdivision_of_articulation_primary", :name => "wikivideo[subdivision_of_articulation_primary]"
      assert_select "input#wikivideo_localization_of_articulation_primary", :name => "wikivideo[localization_of_articulation_primary]"
      assert_select "input#wikivideo_time_spent", :name => "wikivideo[time_spent]"
      assert_select "input#wikivideo_user_id", :name => "wikivideo[user_id]"
    end
  end
end