This repository has been archived by the owner on Jun 24, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make the language attribute for code blocks case insensitive
- Loading branch information
Christian Kruse
committed
Jan 15, 2016
1 parent
48360a9
commit 20bd67e
Showing
2 changed files
with
73 additions
and
0 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
67 changes: 67 additions & 0 deletions
67
spec/features/code_renders_with_case_insensitive_language_spec.rb
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,67 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
require "rails_helper" | ||
|
||
RSpec.describe "highlights with different cases" do | ||
include CForum::Tools | ||
|
||
it "renders to code class=block" do | ||
messages = [] | ||
messages << create(:cf_message, content: <<HTML | ||
~~~html | ||
<html> | ||
~~~ | ||
HTML | ||
) | ||
|
||
messages << create(:cf_message, content: <<HTML | ||
~~~HTML | ||
<html> | ||
~~~ | ||
HTML | ||
) | ||
|
||
messages << create(:cf_message, content: <<HTML | ||
~~~hTmL | ||
<html> | ||
~~~ | ||
HTML | ||
) | ||
|
||
messages.each do |message| | ||
visit cf_message_path(message.thread, message) | ||
expect(page.find(".posting-content code.block")).to have_css("span.nt", text: "<html>") | ||
end | ||
end | ||
|
||
it "renders to code class=block in block quotes" do | ||
messages = [] | ||
messages << create(:cf_message, content: <<HTML | ||
> ~~~html | ||
> <html> | ||
> ~~~ | ||
HTML | ||
) | ||
|
||
messages << create(:cf_message, content: <<HTML | ||
> ~~~html | ||
> <html> | ||
> ~~~ | ||
HTML | ||
) | ||
|
||
messages << create(:cf_message, content: <<HTML | ||
> ~~~html | ||
> <html> | ||
> ~~~ | ||
HTML | ||
) | ||
|
||
messages.each do |message| | ||
visit cf_message_path(message.thread, message) | ||
expect(page.find(".posting-content code.block")).to have_css("span.nt", text: "<html>") | ||
end | ||
end | ||
end | ||
|
||
# eof |