This repository has been archived by the owner on Oct 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
fb644a8
commit 5b49557
Showing
3 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,33 @@ | ||
require 'test_helper' | ||
require 'active_support/json' | ||
|
||
require 'mpg123player/common' | ||
|
||
class PlayersControllerTest < ActionController::TestCase | ||
|
||
class TestClient < Client | ||
def initialize | ||
super | ||
@status = Mpg123Player::Status.stopped | ||
@asynchronous = true | ||
end | ||
|
||
def ok? | ||
true | ||
end | ||
end | ||
|
||
test "issue commands through the client" do | ||
@controller.client = TestClient.new | ||
|
||
post :update, { :command => 'volume', :parameter => '70' } | ||
|
||
assert_response :success | ||
assert @response.body.blank? | ||
|
||
@c = PlayerCommand.flush_queue[0] | ||
assert_equal 'volume', @c.action | ||
assert_equal '70', @c.parameter | ||
end | ||
|
||
end |