Sha256: b716593b2edc2aa76eedf1946de1327163d74088ee215503d6d034d94da711dc
Contents?: true
Size: 1.42 KB
Versions: 3
Compression:
Stored size: 1.42 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Lolita::RestController do render_views before(:each) do @controller.request.env["lolita.mapping"]=Lolita.mappings[:post] end describe "hooks" do it "should call hooks on #index action" do @controller.class.class_variable_set(:"@@temp",1) @controller.before_index do @@temp=2 end get :index @controller.class.class_variable_get(:"@@temp").should == 2 end end it "should render list component for index action" do get :index response.should render_template("index") end it "should overwrite list component body_cell" do pending "Need to be seperated from whole project" Factory.create(:post) get :index response.body.should =~/overwritten cell/ end it "should render tabs for new resource" do get :new response.body.should =~/select|input/ end it "should change name of field's label to 'bar' if title 'bar' given in fields configuration" do tab = Post.lolita.tabs.first tab.type.should == :content tab.fields.by_name(:title).title = "foobar" get :new response.body.should =~/foobar/ end it "should display inline error messages if validations fail" it "should display all error messages at top of from if a validations fail" it "should use field.title instead of field.name when displaying all error messages at top of form" end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
lolita-3.1.6 | spec/controllers/lolita_rest_spec.rb |
lolita-3.1.5 | spec/controllers/lolita_rest_spec.rb |
lolita-3.1.4 | spec/controllers/lolita_rest_spec.rb |