<commit_before># -*- coding: utf-8 -*-
require 'spec_helper'

describe 'notices views' do
  subject { page }
  
  describe 'home' do
    before { visit recordatorios_path }

    # navbar
    it { should have_link('Información', href: root_path) }
    it { should have_link('Recordatorios', href: recordatorios_path) }
    it { should have_link('Preguntas y respuestas', href: respuestas_path) }

    # content
    it { should have_field('user[plate]') }
    it { should have_field('user[verificacion]', :checked) }
    it { should have_field('user[adeudos]', :checked) }
    it { should have_field('user[no_circula_weekday]', :unchecked) }
    it { should have_field('user[no_circula_weekend]', :checked) }
    it { should have_field('Correo electrónico') }
    it { should have_field('Llamada telefónica') }
    
    describe 'via email', :js => true do
      before { choose('Correo electrónico') }
      it { should have_field('email[address]') }
      it { should have_button('Suscribirse') }
      describe 'submit' do
        before do
          fill_in('user[plate]', with: FactoryGirl.generate(:plate))
          fill_in('email[address]', with: FactoryGirl.generate(:address))
          click_button('Suscribirse') 
        end
        it { should have_css('div.alert-info', 
                             :text => /confirmar(.*)visitando la dirección/i) }
      end
    end

    describe 'via phone', :js => true do
      before { choose('Llamada telefónica') }
      it { should have_field('phone[number]') }
      it { should have_field('phone[cellphone]') }
      it { should have_field('phone[morning]', :checked) }
      it { should have_field('phone[afternoon]', :checked) }
      it { should have_field('phone[night]', :unchecked) }
      it { should have_button('Suscribirse') }
      describe 'submit' do
        before do
          fill_in('user[plate]', with: FactoryGirl.generate(:plate))
          fill_in('phone[number]', with: FactoryGirl.generate(:number))
          choose('Teléfono celular')
          click_button('Suscribirse')
        end
        it { should have_css('div.alert-info', 
                             :text => /confirmar(.*)llamada telefonica/i) }
      end
    end
  end
  
  describe 'confirm user email' do
    before do
      @email = FactoryGirl.create(:email)
      @user = @email.user
      visit aviso_path(@user.id)
    end
    it { should have_css('div.alert-success', 
                         :text => /suscripción(.*)confirmada/i) }
  end

end<commit_msg>sync specs con diseño notices<commit_after># -*- coding: utf-8 -*-
require 'spec_helper'

describe 'notices views' do
  subject { page }
  
  describe 'home' do
    before { visit recordatorios_path }

    # navbar
    it { should have_link('Información', href: root_path) }
    it { should have_link('Recordatorios', href: recordatorios_path) }
    it { should have_link('Preguntas y respuestas', href: respuestas_path) }

    # content
    it { should have_field('user[plate]') }
    it { should have_field('user[verificacion]', :checked) }
    it { should have_field('user[adeudos]', :checked) }
    it { should have_field('user[no_circula_weekday]', :unchecked) }
    it { should have_field('user[no_circula_weekend]', :checked) }
    it { should have_field('Correo electrónico') }
    it { should have_field('Llamada telefónica') }
    
    describe 'via email', :js => true do
      before { choose('Correo electrónico') }
      it { should have_field('email[address]') }
      it { should have_button('Suscribirse') }
      describe 'submit' do
        before do
          fill_in('user[plate]', with: FactoryGirl.generate(:plate))
          fill_in('email[address]', with: FactoryGirl.generate(:address))
          click_button('Suscribirse') 
        end
        it { should have_content(/visita la página web que te enviamos/i) }
      end
    end

    describe 'via phone', :js => true do
      before { choose('Llamada telefónica') }
      it { should have_field('phone[number]') }
      it { should have_field('phone[cellphone]') }
      it { should have_field('phone[morning]', :checked) }
      it { should have_field('phone[afternoon]', :checked) }
      it { should have_field('phone[night]', :unchecked) }
      it { should have_button('Suscribirse') }
      describe 'submit' do
        before do
          fill_in('user[plate]', with: FactoryGirl.generate(:plate))
          fill_in('phone[number]', with: FactoryGirl.generate(:number))
          choose('Teléfono celular')
          click_button('Suscribirse')
        end
        it { should have_content(/durante la llamada(.*)debes confirmar/i) }
      end
    end
  end
  
  describe 'confirm user email' do
    before do
      @email = FactoryGirl.create(:email)
      @user = @email.user
      visit aviso_path(@user.id)
    end
    it { should have_content(/tu suscripción esta confirmada/i) }
  end

end
{'fraction_non_alphanumeric': 0.12913771965672252, 'fraction_numerical': 0.0004086636697997548, 'mean_word_length': 2.881839809674861, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '750797', 'n_tokens_mistral': 1596, 'n_tokens_neox': 1536, 'n_words': 356}