Module: MultiTenantSupport::Test::Capybara

Defined in:
lib/multi_tenant_support/test/capybara.rb

Instance Method Summary collapse

Instance Method Details

#evaluate_async_script(script, *args) ⇒ Object



41
42
43
44
45
# File 'lib/multi_tenant_support/test/capybara.rb', line 41

def evaluate_async_script(script, *args)
  keep_context_tenant_unchange do
    super
  end
end

#evaluate_script(script, *args) ⇒ Object



35
36
37
38
39
# File 'lib/multi_tenant_support/test/capybara.rb', line 35

def evaluate_script(script, *args)
  keep_context_tenant_unchange do
    super
  end
end

#keep_context_tenant_unchangeObject



47
48
49
50
51
52
53
# File 'lib/multi_tenant_support/test/capybara.rb', line 47

def keep_context_tenant_unchange
  _current_tenant = MultiTenantSupport::Current.
  MultiTenantSupport::Current. = nil # Simulate real circumstance
  yield
ensure
  MultiTenantSupport::Current. = _current_tenant
end

#perform_click_action(keys, wait: nil, **options) ⇒ Object



23
24
25
26
27
# File 'lib/multi_tenant_support/test/capybara.rb', line 23

def perform_click_action(keys, wait: nil, **options)
  keep_context_tenant_unchange do
    super
  end
end

#select_option(wait: nil) ⇒ Object



11
12
13
14
15
# File 'lib/multi_tenant_support/test/capybara.rb', line 11

def select_option(wait: nil)
  keep_context_tenant_unchange do
    super(wait: wait)
  end
end

#set(value, **options) ⇒ Object



5
6
7
8
9
# File 'lib/multi_tenant_support/test/capybara.rb', line 5

def set(value, **options)
  keep_context_tenant_unchange do
    super(value, **options)
  end
end

#trigger(event) ⇒ Object



29
30
31
32
33
# File 'lib/multi_tenant_support/test/capybara.rb', line 29

def trigger(event)
  keep_context_tenant_unchange do
    super
  end
end

#unselect_option(wait: nil) ⇒ Object



17
18
19
20
21
# File 'lib/multi_tenant_support/test/capybara.rb', line 17

def unselect_option(wait: nil)
  keep_context_tenant_unchange do
    super(wait: wait)
  end
end