Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
taitus committed Sep 23, 2024
1 parent b7806a3 commit d3104cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
30 changes: 12 additions & 18 deletions spec/shared/system/remotely_translatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,20 @@
response = generate_response(resource)
expect_any_instance_of(RemoteTranslations::Microsoft::Client).to receive(:call).and_return(response)

in_browser(:one) do
visit path
select "Español", from: "Language:"
# Navegador 1: Visita la página y selecciona el idioma
visit path
select "Español", from: "Language:"
expect(page).to have_button "Traducir página"

expect(page).to have_button "Traducir página"
end
# Simulación de navegador 2: Otro usuario visita la página y traduce
visit path
select "Español", from: "Language:"
click_button "Traducir página"
expect(page).to have_content "Se han solicitado correctamente las traducciones", wait: 10

in_browser(:two) do
visit path
select "Español", from: "Language:"
click_button "Traducir página"

expect(page).to have_content "Se han solicitado correctamente las traducciones"
end

in_browser(:one) do
click_button "Traducir página"

expect(page).not_to have_button "Traducir página"
end
# Navegador 1: El primer usuario hace clic en traducir
click_button "Traducir página"
expect(page).not_to have_button "Traducir página"
end
end
end
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Dir["./spec/shared/**/*.rb"].sort.each { |f| require f }

RSpec.configure do |config|
Capybara.always_include_port = false
config.use_transactional_fixtures = true
config.fixture_path = "spec/fixtures/files"

Expand Down

0 comments on commit d3104cc

Please sign in to comment.