forked from tyranfou/qwerteach
-
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.
- Loading branch information
Showing
17 changed files
with
203 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,7 @@ def update | |
end | ||
end | ||
|
||
# Not used | ||
# DELETE /galleries/1 | ||
# DELETE /galleries/1.json | ||
def destroy | ||
|
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
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
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'test_helper' | ||
|
||
class GalleryEditTest < ActionDispatch::IntegrationTest | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
|
||
test "get gallery" do | ||
post user_session_path, 'user[email]' => 'y@y.y', 'user[password]' => 'kaltrina' | ||
@gallery=Gallery.where(:user_id => User.find(2)).last.id | ||
get gallery_path(@gallery) | ||
assert_equal 200, status | ||
end | ||
test "get edit gallery" do | ||
post user_session_path, 'user[email]' => 'y@y.y', 'user[password]' => 'kaltrina' | ||
@gallery=Gallery.where(:user_id => User.find(2)).last.id | ||
get edit_gallery_path(@gallery) | ||
assert_equal 200, status | ||
end | ||
test "delete gallery" do | ||
post user_session_path, 'user[email]' => 'y@y.y', 'user[password]' => 'kaltrina' | ||
assert_no_difference 'Gallery.count' do | ||
@gallery = Gallery.where(:user_id => User.find(2)).last | ||
delete gallery_path(@gallery) | ||
end | ||
assert_redirected_to root_path | ||
assert_equal 302, status | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'test_helper' | ||
|
||
class PictureNewTest < ActionDispatch::IntegrationTest | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
|
||
test "get picture" do | ||
post user_session_path, 'user[email]' => 'y@y.y', 'user[password]' => 'kaltrina' | ||
@picture=Gallery.where(:user_id=>User.find(2)).last.pictures.last | ||
get picture_path(@picture) | ||
assert_equal 200, status | ||
end | ||
test "delete picture" do | ||
post user_session_path, 'user[email]' => 'y@y.y', 'user[password]' => 'kaltrina' | ||
@gallery = Gallery.where(:user_id=>User.find(2)).last | ||
@picture=@gallery.pictures.last | ||
delete picture_path(@picture) | ||
assert_redirected_to gallery_path(@gallery) | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'test_helper' | ||
|
||
class UserResendinstructionsTest < ActionDispatch::IntegrationTest | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
test "valid resend instructions" do | ||
get new_user_confirmation_path | ||
post user_confirmation_path, 'user[email]' => 'k@k.k' | ||
assert_redirected_to new_user_session_path | ||
end | ||
test "invalid resend instructions : wrong email" do | ||
get new_user_confirmation_path | ||
post user_confirmation_path, 'user[email]' => 'y@k.k' | ||
assert_template 'devise/confirmations/new' | ||
end | ||
test "invalid resend instructions : empty email" do | ||
get new_user_confirmation_path | ||
post user_confirmation_path, 'user[email]' => '' | ||
assert_template 'devise/confirmations/new' | ||
end | ||
test "invalid resend instructions : already confirmed" do | ||
get new_user_confirmation_path | ||
post user_confirmation_path, 'user[email]' => 'y@y.y' | ||
assert_template 'devise/confirmations/new' | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'test_helper' | ||
|
||
class UserResetpasswordTest < ActionDispatch::IntegrationTest | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
|
||
test "valid reset pwd" do | ||
get new_user_password_path | ||
post user_password_path, 'user[email]' => 'y@y.y' | ||
assert_redirected_to new_user_session_path | ||
end | ||
test "invalid reset pwd : wrong email" do | ||
get new_user_password_path | ||
post user_password_path, 'user[email]' => 'k@y.y' | ||
assert_template 'devise/passwords/new' | ||
end | ||
test "invalid reset pwd : empty email" do | ||
get new_user_password_path | ||
post user_password_path, 'user[email]' => '' | ||
assert_template 'devise/passwords/new' | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require 'test_helper' | ||
|
||
class UserUnlockinstructionsTest < ActionDispatch::IntegrationTest | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
test "valid unlock instructions" do | ||
User.find(1).lock_access! | ||
get new_user_unlock_path | ||
post user_unlock_path, 'user[email]' => 'k@k.k' | ||
assert_redirected_to new_user_session_path | ||
end | ||
test "invalid unlock instructions : wrong email" do | ||
get new_user_unlock_path | ||
post user_unlock_path, 'user[email]' => 'y@k.k' | ||
assert_template 'devise/unlocks/new' | ||
end | ||
test "invalid unlock instructions : empty email" do | ||
get new_user_unlock_path | ||
post user_unlock_path, 'user[email]' => '' | ||
assert_template 'devise/unlocks/new' | ||
end | ||
test "invalid unlock instructions : not locked" do | ||
get new_user_unlock_path | ||
post user_unlock_path, 'user[email]' => 'y@y.y' | ||
assert_template 'devise/unlocks/new' | ||
end | ||
end |
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