mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-17 06:52:27 +01:00
[ongoing] availability tests
This commit is contained in:
parent
02c72e55d9
commit
c0f57cc213
@ -4,10 +4,23 @@ class AvailabilitiesTest < ActionDispatch::IntegrationTest
|
||||
login_as(admin, scope: :user)
|
||||
end
|
||||
|
||||
test "return availability by id" do
|
||||
test 'return availability by id' do
|
||||
a = Availability.take
|
||||
|
||||
get "/api/availabilities/#{a.id}"
|
||||
|
||||
# Check response format & status
|
||||
assert_equal 200, response.status
|
||||
assert_equal Mime::JSON, response.content_type
|
||||
|
||||
# Check the correct availability was returned
|
||||
availability = json_response(response.body)
|
||||
assert_equal a.id, availability[:id], 'availability id does not match'
|
||||
end
|
||||
|
||||
test 'get machine availabilities' do
|
||||
m = Machine.find_by_slug('decoupeuse-vinyle')
|
||||
|
||||
get "/api/availabilities/machines/#{m.id}"
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user