Sha256: aefdf4eec97e19241508c2224ec153dfbe8c771abee0687522e91c484e1e6d81
Contents?: true
Size: 1003 Bytes
Versions: 14
Compression:
Stored size: 1003 Bytes
Contents
require 'spec_helper' describe RailsBestPractices::Reviews::MoveCodeIntoHelperReview do let(:runner) { RailsBestPractices::Core::Runner.new(:reviews => RailsBestPractices::Reviews::MoveCodeIntoHelperReview.new('array_count' => 2)) } it "should move code into helper" do content = <<-EOF <%= select_tag :state, options_for_select( [[t(:draft), "draft"], [t(:published), "published"]], params[:default_state] ) %> EOF runner.review('app/views/posts/show.html.erb', content) runner.should have(1).errors runner.errors[0].to_s.should == "app/views/posts/show.html.erb:3 - move code into helper (array_count >= 2)" end it "should not move code into helper with simple arguments" do content = <<-EOF <%= select_tag :state, options_for_select( Post.STATES ) %> EOF runner.review('app/views/posts/show.html.erb', content) runner.should have(0).errors end end
Version data entries
14 entries across 14 versions & 2 rubygems