Commit ee8b1d1ccbd945a7936faee39c13f80d9782d4b5
1 parent
47085886
Exists in
master
and in
1 other branch
Fixed case where uri.host == nil because url was file:///
Showing
2 changed files
with
6 additions
and
1 deletions
Show diff stats
app/models/notice.rb
spec/models/notice_spec.rb
... | ... | @@ -89,6 +89,11 @@ describe Notice, type: 'model' do |
89 | 89 | end |
90 | 90 | |
91 | 91 | it "returns 'N/A' when url is not valid" do |
92 | + notice = Fabricate.build(:notice, :request => {'url' => "file:///path/to/some/resource/12"}) | |
93 | + expect(notice.host).to eq 'N/A' | |
94 | + end | |
95 | + | |
96 | + it "returns 'N/A' when url is not valid" do | |
92 | 97 | notice = Fabricate.build(:notice, :request => {'url' => "some string"}) |
93 | 98 | expect(notice.host).to eq 'N/A' |
94 | 99 | end | ... | ... |