mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-17 06:52:27 +01:00
adds a dummy integration test
This commit is contained in:
parent
26e3f5bf8c
commit
272400a889
16
test/integration/availabilities_test.rb
Normal file
16
test/integration/availabilities_test.rb
Normal file
@ -0,0 +1,16 @@
|
||||
class AvailabilitiesTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@profile = Profile.create!(gender: true, birthday: 20.years.ago, first_name: "Admin", last_name: "Sleede", phone: "06542868451")
|
||||
@admin = User.create!(cgu: true, username: 'blabla', email: 'abc@sleede.com', password: 'kikoulol', password_confirmation: 'kikoulol', profile: @profile)
|
||||
@admin.add_role(:admin)
|
||||
login_as(@admin, scope: :user)
|
||||
end
|
||||
|
||||
test "return availability by id" do
|
||||
a = Availability.create!(start_at: Time.now, end_at: 2.hours.from_now, available_type: 'trainings')
|
||||
|
||||
|
||||
get "/api/availabilities/#{a.id}"
|
||||
assert_equal 200, response.status
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user