Skip to content

Commit

Permalink
コメントアウトの記法を変更
Browse files Browse the repository at this point in the history
  • Loading branch information
machida committed Feb 10, 2022
1 parent 731e8ac commit 4e34beb
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 65 deletions.
46 changes: 22 additions & 24 deletions test/system/practices_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,28 @@ class PracticesTest < ApplicationSystemTestCase
assert_no_link '提出物を作る'
end

test 'complete and tweet' do
visit_with_auth "/practices/#{practices(:practice2).id}", 'kimura'
find('#js-complete').click
assert_text '喜びを Tweet する!'

click_link '喜びを Tweet する!'
switch_to_window(windows.last)
assert_includes current_url, 'https://twitter.com/intent/tweet'
end

=begin
[TODO]完了Tweetの正式リリース後にコメントを外す
test 'can see tweet button when current_user has completed a practice' do
visit_with_auth "/practices/#{practices(:practice1).id}", 'kimura'
assert_text '完了 Tweet する'
find(:label, '完了 Tweet する').click
assert_text '喜びを Tweet する!'
click_link '喜びを Tweet する!'
switch_to_window(windows.last)
assert_includes current_url, 'https://twitter.com/intent/tweet'
end
=end
# [TODO]完了Tweetの正式リリース後にコメントを外す
# test 'complete and tweet' do
# visit_with_auth "/practices/#{practices(:practice2).id}", 'kimura'
# find('#js-complete').click
# assert_text '喜びを Tweet する!'

# click_link '喜びを Tweet する!'
# switch_to_window(windows.last)
# assert_includes current_url, 'https://twitter.com/intent/tweet'
# end
#
# test 'can see tweet button when current_user has completed a practice' do
# visit_with_auth "/practices/#{practices(:practice1).id}", 'kimura'
# assert_text '完了 Tweet する'

# find(:label, '完了 Tweet する').click
# assert_text '喜びを Tweet する!'

# click_link '喜びを Tweet する!'
# switch_to_window(windows.last)
# assert_includes current_url, 'https://twitter.com/intent/tweet'
# end

test "only show when user isn't admin " do
visit_with_auth "/practices/#{practices(:practice1).id}/edit", 'yamada'
Expand Down
80 changes: 39 additions & 41 deletions test/system/products_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,47 +39,45 @@ class ProductsTest < ApplicationSystemTestCase
assert_text 'プラクティスを完了するまで他の人の提出物は見れません。'
end

=begin
[TODO]完了Tweetの正式リリース後にコメントを外す
test 'can not see tweet button when current_user does not complete a practice' do
visit_with_auth "/products/#{products(:product1).id}", 'yamada'
assert_no_text '完了 Tweet する'
end
test 'display learning completion message when a user of the completed product visits show first time' do
visit_with_auth "/products/#{products(:product65).id}", 'kimura'
assert_text '喜びを Tweet する!'
end
test 'not display learning completion message when a user of the completed product visits after the second time' do
visit_with_auth "/products/#{products(:product65).id}", 'kimura'
find('label.card-main-actions__delete').click
visit current_path
assert_no_text '喜びを Tweet する!'
end
test 'not display learning completion message when a user whom the product does not belongs to visits show' do
visit_with_auth "/products/#{products(:product65).id}", 'yamada'
assert_no_text '喜びを Tweet する!'
end
test 'not display learning completion message when a user of the non-completed product visits show' do
visit_with_auth "/products/#{products(:product6).id}", 'sotugyou'
assert_no_text '喜びを Tweet する!'
end
test 'can see tweet button when current_user has completed a practice' do
visit_with_auth "/products/#{products(:product2).id}", 'kimura'
assert_text '完了 Tweet する'
find('.a-button.is-tweet').click
assert_text '喜びを Tweet する!'
click_link '喜びを Tweet する!'
switch_to_window(windows.last)
assert_includes current_url, 'https://twitter.com/intent/tweet'
end
=end
# [TODO]完了Tweetの正式リリース後にコメントを外す
# test 'can not see tweet button when current_user does not complete a practice' do
# visit_with_auth "/products/#{products(:product1).id}", 'yamada'
# assert_no_text '完了 Tweet する'
# end

# test 'display learning completion message when a user of the completed product visits show first time' do
# visit_with_auth "/products/#{products(:product65).id}", 'kimura'
# assert_text '喜びを Tweet する!'
# end

# test 'not display learning completion message when a user of the completed product visits after the second time' do
# visit_with_auth "/products/#{products(:product65).id}", 'kimura'
# find('label.card-main-actions__delete').click
# visit current_path
# assert_no_text '喜びを Tweet する!'
# end

# test 'not display learning completion message when a user whom the product does not belongs to visits show' do
# visit_with_auth "/products/#{products(:product65).id}", 'yamada'
# assert_no_text '喜びを Tweet する!'
# end

# test 'not display learning completion message when a user of the non-completed product visits show' do
# visit_with_auth "/products/#{products(:product6).id}", 'sotugyou'
# assert_no_text '喜びを Tweet する!'
# end

# test 'can see tweet button when current_user has completed a practice' do
# visit_with_auth "/products/#{products(:product2).id}", 'kimura'
# assert_text '完了 Tweet する'

# find('.a-button.is-tweet').click
# assert_text '喜びを Tweet する!'

# click_link '喜びを Tweet する!'
# switch_to_window(windows.last)
# assert_includes current_url, 'https://twitter.com/intent/tweet'
# end

test 'create product' do
visit_with_auth "/products/new?practice_id=#{practices(:practice6).id}", 'yamada'
Expand Down

0 comments on commit 4e34beb

Please sign in to comment.