Pessoal,
Conclui o desafio do App1 e está funcional a busca automática, quando troca de moeda ou digita no campo de valor é feito a busca AJAX, porém meu teste não está passando apenas comentei o click do botão.
require 'rails_helper'
RSpec.describe "Exchange Currency Process", :type => :feature do
it "exchange value" do
visit '/'
within("#exchange_form") do
select('EUR', from: 'currency')
select('USD', from: 'currency_destination')
fill_in 'quantity', with: '10'
end
# click_button 'CONVERTER'
# save_and_open_page
expect(page).to have_content("value")
end
end
Apresenta o seguinte erro:
Failures:
1) Exchange Currency Process exchange value
Failure/Error: expect(page).to have_content("value")
expected to find text "value" in "Simule sua conversão Moeda Local AUD BGN BRL CAD CHF CNY CZK DKK EUR GBP HKD HRK HUF IDR ILS INR JPY KRW MXN MYR NOK NZD PHP PLN RON RUB SEK SGD THB
TRY USD ZAR Moeda Pretendida AUD BGN BRL CAD CHF CNY CZK DKK EUR GBP HKD HRK HUF IDR ILS INR JPY KRW MXN MYR NOK NZD PHP PLN RON RUB SEK SGD THB TRY USD ZAR CONVERTER Converta facilmente sua
s Moedas Para qualquer moeda no Mundo!"
# ./spec/features/home_spec.rb:14:in `block (2 levels) in <top (required)>'
Finished in 4.45 seconds (files took 10.91 seconds to load)
5 examples, 1 failure
Failed examples:
rspec ./spec/features/home_spec.rb:4 # Exchange Currency Process exchange value