Skip to content

Commit 2a28bdb

Browse files
committed
Fix CommitsControllerTest
Seems fixtures behavior is changed: * Before - `commits(*[])` returns nil * After - `commits(*[])` returns Commit.all - `commits(*[])` same as `commits`
1 parent fabf589 commit 2a28bdb

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

test/controllers/commits_controller_test.rb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
class CommitsControllerTest < ActionController::TestCase
44
def test_index_for_releases
55
cases = [
6-
[:v3_2_0, [:commit_6c65676, :commit_5b90635]],
7-
[:v2_3_2, []],
8-
[:v0_14_4, [:commit_e0ef631]],
9-
].map {|a, b| [releases(a), Array(commits(*b))]}
6+
[releases(:v3_2_0), Array(commits(:commit_6c65676, :commit_5b90635))],
7+
[releases(:v2_3_2), []],
8+
[releases(:v0_14_4), Array(commits(:commit_e0ef631))],
9+
]
1010

1111
cases.each do |release, commits|
1212
get :index, params: { release_id: release }
@@ -45,31 +45,31 @@ def test_commits_in_time_window
4545

4646
cases = {
4747
contributors(:david) => [
48-
['all-time', [:commit_339e4e8, :commit_e0ef631]],
48+
['all-time', Array(commits(:commit_339e4e8, :commit_e0ef631))],
4949
['today', []],
5050
['this-week', []],
51-
['this-year', :commit_339e4e8],
51+
['this-year', Array(commits(:commit_339e4e8))],
5252
[since, []],
53-
[date_range, :commit_339e4e8],
54-
].map {|a, b| [a, Array(commits(*b))]},
53+
[date_range, Array(commits(:commit_339e4e8))],
54+
],
5555

5656
contributors(:jeremy) => [
57-
['all-time', [:commit_b821094, :commit_7cdfd91, :commit_5b90635]],
58-
['today', :commit_b821094],
59-
['this-week', :commit_b821094],
60-
['this-year', [:commit_b821094, :commit_7cdfd91, :commit_5b90635]],
61-
[since, :commit_b821094],
62-
[date_range, :commit_b821094],
63-
].map {|a, b| [a, Array(commits(*b))]},
57+
['all-time', Array(commits(:commit_b821094, :commit_7cdfd91, :commit_5b90635))],
58+
['today', Array(commits(:commit_b821094))],
59+
['this-week', Array(commits(:commit_b821094))],
60+
['this-year', Array(commits(:commit_b821094, :commit_7cdfd91, :commit_5b90635))],
61+
[since, Array(commits(:commit_b821094))],
62+
[date_range, Array(commits(:commit_b821094))],
63+
],
6464

6565
contributors(:vijay) => [
66-
['all-time', :commit_6c65676],
66+
['all-time', Array(commits(:commit_6c65676))],
6767
['today', []],
6868
['this-week', []],
69-
['this-year', :commit_6c65676],
69+
['this-year', Array(commits(:commit_6c65676))],
7070
[since, []],
7171
[date_range, []],
72-
].map {|a, b| [a, Array(commits(*b))]},
72+
],
7373
}
7474

7575
time_travel do

0 commit comments

Comments
 (0)