Topic: What is this test testing?

I attended an Engine Yard Rails training course and this is one of the tests that I they had us write.   And for the life of me, I don't understand what good this test is adding.    Can someone explain the value of this unit test?

require 'spec_helper'

describe HotelsController do

  def mock_hotel(stubs={})
    (@mock_hotel ||= mock_model(Hotel).as_null_object).tap do |hotel|
      hotel.stub(stubs) unless stubs.empty?

  before :each do
    system("rake db:seed")

  describe "with valid params" do
    it "assigns a newly created hotel as @hotel" do
      Hotel.stub(:new).with({'these' => 'params'}) { mock_hotel(:save => true) }
      post :create, :hotel => {'these' => 'params'}
      assigns(:hotel).should be(mock_hotel)


Re: What is this test testing?

It is testing that the @hotel variable is being set properly for use in your view.
This way another developer will not accidentally remove your @hotel variable and break the views.