Sha256: 418e4dafb4f2fda22059c1c52cdf3e7f7b91bb0397a4fc2599b7951734656448
Contents?: true
Size: 908 Bytes
Versions: 14
Compression:
Stored size: 908 Bytes
Contents
require 'spec_helper' describe RailsBestPractices::Reviews::MoveCodeIntoControllerReview do let(:runner) { RailsBestPractices::Core::Runner.new(:reviews => RailsBestPractices::Reviews::MoveCodeIntoControllerReview.new) } it "should move code into controller" do content = <<-EOF <% @posts = Post.find(:all) %> <% @posts.each do |post| %> <%=h post.title %> <%=h post.content %> <% end %> EOF runner.review('app/views/posts/index.html.erb', content) runner.should have(1).errors runner.errors[0].to_s.should == "app/views/posts/index.html.erb:1 - move code into controller" end it "should not move code into controller" do content = <<-EOF <% @posts.each do |post| %> <%=h post.title %> <%=h post.content %> <% end %> EOF runner.review('app/views/posts/index.html.erb', content) runner.should have(0).errors end end
Version data entries
14 entries across 14 versions & 2 rubygems