mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-17 15:50:13 +01:00
move tests to new directory
This commit is contained in:
parent
65859807ea
commit
0bc9b0397a
42 changed files with 23 additions and 32 deletions
34
test/controllers/context_actions_data_test.rb
Normal file
34
test/controllers/context_actions_data_test.rb
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
||||
|
||||
class ContextActionsDataTest < ActionController::TestCase
|
||||
tests StatsController
|
||||
|
||||
def test_total_with_more_than_10_items
|
||||
login_as(:admin_user)
|
||||
contexts = [
|
||||
{'id' => 1, 'name' => 'one', 'total' => 11},
|
||||
{'id' => 2, 'name' => 'two', 'total' => 4},
|
||||
{'id' => 3, 'name' => 'three', 'total' => 8}
|
||||
]
|
||||
Stats::TopContextsQuery.any_instance.stubs(:result).returns contexts
|
||||
|
||||
get :context_total_actions_data
|
||||
|
||||
assert_equal [47, 17, 34], assigns[:data].values
|
||||
end
|
||||
|
||||
def test_running_actions
|
||||
login_as(:admin_user)
|
||||
contexts = [
|
||||
{'id' => 1, 'name' => 'one', 'total' => 11},
|
||||
{'id' => 2, 'name' => 'two', 'total' => 4},
|
||||
{'id' => 3, 'name' => 'three', 'total' => 8}
|
||||
]
|
||||
Stats::TopContextsQuery.any_instance.stubs(:result).returns contexts
|
||||
|
||||
get :context_running_actions_data
|
||||
|
||||
assert_equal [47, 17, 34], assigns[:data].values
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue