<commit_before>require 'spec_helper'

describe "gend_image_pages/show.html.erb" do

  let(:gend_image) { FactoryGirl.create(:gend_image, work_in_progress: false) }
  let(:src_image) { FactoryGirl.create(:src_image) }
  let(:gend_image_url) {
    url_for(controller: :gend_images, action: :show, id: gend_image.id_hash)
  }
  let(:android) { false }

  before do
    assign(:gend_image, gend_image)
    assign(:src_image, src_image)
    assign(:gend_image_url, gend_image_url)

    view.stub_chain(:browser, :android?) { android }
  end

  subject { render }

  context 'browser' do

    context 'when the browser is not Android' do
      it { should_not contain('SMS') }
    end

    context 'when the browser is Android' do
      let(:android) { true }

      it { should contain('SMS') }
    end
  end

  it { should have_selector 'img[width="399"]' }

  it { should have_selector 'img[height="399"]' }

end<commit_msg>Don't call render in subject.<commit_after>require 'spec_helper'

describe "gend_image_pages/show.html.erb" do

  let(:gend_image) { FactoryGirl.create(:gend_image, work_in_progress: false) }
  let(:src_image) { FactoryGirl.create(:src_image) }
  let(:gend_image_url) {
    url_for(controller: :gend_images, action: :show, id: gend_image.id_hash)
  }
  let(:android) { false }

  before do
    assign(:gend_image, gend_image)
    assign(:src_image, src_image)
    assign(:gend_image_url, gend_image_url)

    view.stub_chain(:browser, :android?) { android }
  end

  context 'browser' do

    context 'when the browser is not Android' do

      it 'does not have the SMS button' do
        expect(render).to_not contain 'SMS'
      end

    end

    context 'when the browser is Android' do
      let(:android) { true }

      it 'has the SMS button' do
        expect(render).to contain 'SMS'
      end
    end
  end

  it 'has the image width' do
    expect(render).to have_selector 'img[width="399"]'
  end

  it 'has the image height' do
    expect(render).to have_selector 'img[height="399"]'
  end

end
{'fraction_non_alphanumeric': 0.11631345490389354, 'fraction_numerical': 0.005914243469689502, 'mean_word_length': 3.561797752808989, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7143879', 'n_tokens_mistral': 730, 'n_tokens_neox': 693, 'n_words': 173}