Skip to content

Commit

Permalink
CircleCIテスト確認用コミット
Browse files Browse the repository at this point in the history
  • Loading branch information
taco committed Mar 8, 2024
1 parent e0b1ba6 commit 5653443
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/models/company.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ class Company < ApplicationRecord

def logo_url
if logo.attached?
print 'A'
logo.variant(resize: LOGO_SIZE).processed.url
else
print 'B'
image_url('/images/companies/logos/default.png')
end
rescue ActiveStorage::FileNotFoundError
print 'C'
image_url('/images/companies/logos/default.png')
end
end
4 changes: 3 additions & 1 deletion test/system/answers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,16 @@ class AnswersTest < ApplicationSystemTestCase
end

test 'the company logo is shown when an adviser who belongs to a company posts an answer' do
print 'F'
visit_with_auth "/questions/#{questions(:question2).id}", 'senpai'
within('.thread-comment-form__form') do
fill_in('answer[description]', with: 'test')
end
page.all('.a-form-tabs__tab.js-tabs__tab')[1].click
click_button 'コメントする'
assert_text 'test'
assert_includes ['2.png', 'default.png'], File.basename(find('img.thread-comment__company-logo')['src'])
assert_includes ['2.png'], File.basename(find('img.thread-comment__company-logo')['src'])
# assert_includes ['2.png', 'default.png'], File.basename(find('img.thread-comment__company-logo')['src'])
end

test 'using file uploading by file selection dialogue in textarea' do
Expand Down
4 changes: 3 additions & 1 deletion test/system/attachments_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ class AttachmentsTest < ApplicationSystemTestCase
end

test 'attachment company icons in reports' do
print 'E'
report = reports(:report11)
visit_with_auth "/reports/#{report.id}", 'kensyu'
assert_includes ['2.png', 'default.png'], File.basename(find('img.page-content-header__company-logo')['src'])
assert_includes ['2.png'], File.basename(find('img.page-content-header__company-logo')['src'])
# assert_includes ['2.png', 'default.png'], File.basename(find('img.page-content-header__company-logo')['src'])
end
end
4 changes: 3 additions & 1 deletion test/system/comments_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,13 @@ class CommentsTest < ApplicationSystemTestCase
end

test 'company logo appear when adviser belongs to the company post comment' do
print 'D'
visit_with_auth "/reports/#{reports(:report1).id}", 'senpai'
fill_in('new_comment[description]', with: 'test')
click_button 'コメントする'
assert_text 'test'
assert_includes ['2.png', 'default.png'], File.basename(find('img.thread-comment__company-logo')['src'])
assert_includes ['2.png'], File.basename(find('img.thread-comment__company-logo')['src'])
# assert_includes ['2.png', 'default.png'], File.basename(find('img.thread-comment__company-logo')['src'])
end

test 'using file uploading by file selection dialogue in textarea' do
Expand Down

0 comments on commit 5653443

Please sign in to comment.