Sha256: 31167322557315412c7b4f17b931a7161d958f7f970149f8ac389c17ed593082
Contents?: true
Size: 969 Bytes
Versions: 1
Compression:
Stored size: 969 Bytes
Contents
require File.join(File.dirname(__FILE__) + '/../../spec_helper') describe RailsBestPractices::Checks::MoveCodeIntoHelperCheck do before(:each) do @runner = RailsBestPractices::Core::Runner.new(RailsBestPractices::Checks::MoveCodeIntoHelperCheck.new) end 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.check('app/views/posts/show.html.erb', content) errors = @runner.errors errors.should_not be_empty end it "should not move code into helper with simple arguments" do content = <<-EOF <%= select_tag :state, options_for_select( Post.STATES ) %> EOF @runner.check('app/views/posts/show.html.erb', content) errors = @runner.errors errors.should be_empty end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails_best_practices-0.2.15 | spec/rails_best_practices/checks/move_code_into_helper_check_spec.rb |