Commit 552c6d4598f6396456c569cfece98ae469bfa84c

Authored by Dmitriy Zaporozhets
1 parent 9ada6788

Make tests green for postgres

.travis.yml
... ... @@ -19,8 +19,7 @@ services:
19 19 before_script:
20 20 - "cp config/database.yml.$DB config/database.yml"
21 21 - "cp config/gitlab.yml.example config/gitlab.yml"
22   - - "bundle exec rake db:create RAILS_ENV=test"
23   - - "bundle exec rake db:migrate RAILS_ENV=test"
  22 + - "bundle exec rake db:setup RAILS_ENV=test"
24 23 - "bundle exec rake db:seed_fu RAILS_ENV=test"
25 24 - "sh -e /etc/init.d/xvfb start"
26 25 script: "bundle exec rake travis --trace"
... ...
Gemfile
... ... @@ -124,7 +124,7 @@ group :development, :test do
124 124 gem "capybara"
125 125 gem "pry"
126 126 gem "awesome_print"
127   - gem "database_cleaner"
  127 + gem "database_cleaner", ref: "f89c34300e114be99532f14c115b2799a3380ac6", git: "https://github.com/bmabey/database_cleaner.git"
128 128 gem "launchy"
129 129 gem 'factory_girl_rails'
130 130  
... ...
Gemfile.lock
1 1 GIT
  2 + remote: https://github.com/bmabey/database_cleaner.git
  3 + revision: f89c34300e114be99532f14c115b2799a3380ac6
  4 + ref: f89c34300e114be99532f14c115b2799a3380ac6
  5 + specs:
  6 + database_cleaner (0.9.1)
  7 +
  8 +GIT
2 9 remote: https://github.com/ctran/annotate_models.git
3 10 revision: be4e26825b521f0b2d86b181e2dff89901aa9b1e
4 11 specs:
... ... @@ -140,7 +147,6 @@ GEM
140 147 colorize (0.5.8)
141 148 crack (0.3.1)
142 149 daemons (1.1.9)
143   - database_cleaner (0.9.1)
144 150 devise (2.1.2)
145 151 bcrypt-ruby (~> 3.0)
146 152 orm_adapter (~> 0.1)
... ... @@ -458,7 +464,7 @@ DEPENDENCIES
458 464 chosen-rails (= 0.9.8)
459 465 coffee-rails (~> 3.2.2)
460 466 colored
461   - database_cleaner
  467 + database_cleaner!
462 468 devise (~> 2.1.0)
463 469 draper (~> 0.18.0)
464 470 email_spec
... ...
features/support/env.rb
... ... @@ -36,8 +36,6 @@ Spinach.hooks.before_scenario do
36 36 Gitlab.config.stub(git_base_path: Rails.root.join('tmp', 'test-git-base-path'))
37 37 FileUtils.rm_rf Gitlab.config.git_base_path
38 38 FileUtils.mkdir_p Gitlab.config.git_base_path
39   -
40   - DatabaseCleaner.start
41 39 end
42 40  
43 41 Spinach.hooks.after_scenario do
... ...
spec/requests/issues_spec.rb
... ... @@ -91,13 +91,13 @@ describe "Issues" do
91 91 title: title)
92 92 end
93 93  
94   - issue = Issue.first # with title 'foobar'
95   - issue.milestone = create(:milestone, project: project)
96   - issue.assignee = nil
97   - issue.save
  94 + @issue = Issue.first # with title 'foobar'
  95 + @issue.milestone = create(:milestone, project: project)
  96 + @issue.assignee = nil
  97 + @issue.save
98 98 end
99 99  
100   - let(:issue) { Issue.first }
  100 + let(:issue) { @issue }
101 101  
102 102 it "should allow filtering by issues with no specified milestone" do
103 103 visit project_issues_path(project, milestone_id: '0')
... ...