Commit de1cd644700cd8f5da521ea865b8c2d66025d730

Authored by Cyril Mougel
1 parent 48eb8a6a
Exists in master and in 1 other branch production

fix spec/views with fabrication

spec/views/apps/index.html.haml_spec.rb
... ... @@ -2,9 +2,9 @@ require 'spec_helper'
2 2  
3 3 describe "apps/index.html.haml" do
4 4 before do
5   - app = Factory(:app, :deploys => [Factory(:deploy, :revision => "123456789abcdef")])
  5 + app = Fabricate(:app, :deploys => [Fabricate(:deploy, :revision => "123456789abcdef")])
6 6 assign :apps, [app]
7   - controller.stub(:current_user) { Factory(:user) }
  7 + controller.stub(:current_user) { Fabricate(:user) }
8 8 end
9 9  
10 10 describe "deploy column" do
... ...
spec/views/errs/show.html.haml_spec.rb
... ... @@ -2,15 +2,15 @@ require 'spec_helper'
2 2  
3 3 describe "errs/show.html.haml" do
4 4 before do
5   - err = Factory(:err)
  5 + err = Fabricate(:err)
6 6 problem = err.problem
7   - comment = Factory(:comment)
  7 + comment = Fabricate(:comment)
8 8 assign :problem, problem
9 9 assign :comment, comment
10 10 assign :app, problem.app
11 11 assign :notices, err.notices.page(1).per(1)
12 12 assign :notice, err.notices.first
13   - controller.stub(:current_user) { Factory(:user) }
  13 + controller.stub(:current_user) { Fabricate(:user) }
14 14 end
15 15  
16 16 describe "content_for :action_bar" do
... ... @@ -46,7 +46,7 @@ describe "errs/show.html.haml" do
46 46 end
47 47  
48 48 it 'should display comments and new comment form when no issue tracker' do
49   - problem = Factory(:problem_with_comments)
  49 + problem = Fabricate(:problem_with_comments)
50 50 assign :problem, problem
51 51 assign :app, problem.app
52 52 render
... ... @@ -63,14 +63,15 @@ describe "errs/show.html.haml" do
63 63 end
64 64  
65 65 it 'should not display the comments section' do
66   - problem = Factory(:problem)
  66 + problem = Fabricate(:problem)
67 67 with_issue_tracker(problem)
68 68 render
69 69 view.instance_variable_get(:@_content_for)[:comments].should be_blank
70 70 end
71 71  
72 72 it 'should display existing comments' do
73   - problem = Factory(:problem_with_comments)
  73 + problem = Fabricate(:problem_with_comments)
  74 + problem.reload
74 75 with_issue_tracker(problem)
75 76 render
76 77 comments_section = String.new(view.instance_variable_get(:@_content_for)[:comments])
... ...
spec/views/notices/_backtrace.html.haml_spec.rb
... ... @@ -3,7 +3,7 @@ require 'spec_helper'
3 3 describe "notices/_backtrace.html.haml" do
4 4 describe 'missing file in backtrace' do
5 5 before do
6   - @notice = Factory(:notice, :backtrace => [{
  6 + @notice = Fabricate(:notice, :backtrace => [{
7 7 'number' => rand(999),
8 8 'file' => nil,
9 9 'method' => ActiveSupport.methods.shuffle.first
... ...