Sha256: e164a8412d20fe18fd370f1c7704ed3ee3d9594efba67f452843419ea8ee338b

Contents?: true

Size: 930 Bytes

Versions: 2

Compression:

Stored size: 930 Bytes

Contents

# frozen_string_literal: true

# Test gem works

page = GenericTest.pages.first
links = page.links

RSpec.describe 'Links' do
  it 'counts correctly (not include )' do
    expect(links.size).to eq 3
  end
  context 'successful' do
    it 'external page' do
      expect(Checker.link_status(links[0].href)).to be_between 200, 399
    end
    it 'internal link' do
      expect(Checker.link_status(links[2].href)).to be_between 200, 399
    end
  end
  it 'broken causes failure' do
    expect(Checker.link_status(links[1].href)).to eq 404
  end
end
puts page.emails
RSpec.describe 'Emails' do
  it 'counts correctly' do
    expect(page.emails.size).to eq 2
  end
  context 'validate' do
    it 'accepts valid email' do
      expect(Checker.valid_email?(page.emails[0])).to be nil
    end
    it 'returns invalid email error' do
      expect(Checker.valid_email?(page.emails[1])).to eq 'Domain name not registered'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
generic_test-0.1.11 spec/test_gem_spec.rb
generic_test-0.1.10 spec/test_gem_spec.rb