Skip to content

Commit 1d43038

Browse files
committed
URLの表示簡略化のためのテストを追加(TDD: Redフェーズ)
- ノート欄のURLから http:// と https:// を削除することをテスト - 現時点ではテストは失敗する(期待通り)
1 parent b4d1ba3 commit 1d43038

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

spec/requests/dojos_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,26 @@
376376
expect(response.body).to include("(ID: #{@active_dojo.id})")
377377
expect(response.body).to include("道場名")
378378
end
379+
380+
it "displays URLs without http:// or https:// in note column" do
381+
# URLを含むnoteを持つ道場を作成
382+
create(:dojo,
383+
name: "Test Dojo",
384+
note: "Active https://example.com/ and http://test.com/",
385+
inactivated_at: nil
386+
)
387+
388+
get activity_dojos_path
389+
390+
# ノート欄の表示テキストに http:// や https:// が含まれないことを確認
391+
doc = Nokogiri::HTML(response.body)
392+
note_cells = doc.css('td.url-cell')
393+
394+
test_cell = note_cells.find { |cell| cell.text.include?("example.com") }
395+
expect(test_cell).not_to be_nil
396+
expect(test_cell.text).not_to include("https://")
397+
expect(test_cell.text).not_to include("http://")
398+
end
379399
end
380400

381401
describe "GET /dojos/activity - note date priority" do

0 commit comments

Comments
 (0)