我正在跟踪rails3tutorial,并且在做一些测试时,我不明白“it”关键字的含义如下:
- require 'spec_helper'
- describe UsersController do
- render_views
- describe "GET 'new'" do
- it "should be successful" do
- get 'new'
- response.should be_success
- end
- it "should have the right title" do
- get 'new'
- response.should have_selector("title",:content => "Sign up")
- end
- end
- end
代码片段来自:http://ruby.railstutorial.org/chapters/filling-in-the-layout#top上市5.26
解决方法
它不是Ruby关键字,它是
Rspec framework的一部分.