mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Rework the Sign Up/Sign In views
Use Capybaras save_page when feature tests go wrong
This commit is contained in:
parent
76028f5755
commit
5f96c276e9
24 changed files with 326 additions and 100 deletions
|
|
@ -26,7 +26,7 @@ module OmniauthMacros
|
|||
def mock_auth_new_user_fb
|
||||
OmniAuth.config.mock_auth[:facebook] =
|
||||
OmniAuth::AuthHash.new(
|
||||
provider: 'google',
|
||||
provider: 'facebook',
|
||||
uid: 'facebook-test-uid-1',
|
||||
info: {
|
||||
name: 'new user fb name',
|
||||
|
|
|
|||
18
spec/support/save_feature_failures.rb
Normal file
18
spec/support/save_feature_failures.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Automatically save and open the page
|
||||
# whenever an expectation is not met in a features spec
|
||||
RSpec.configure do |config|
|
||||
config.after(:each, type: :feature) do
|
||||
ename = RSpec.current_example.full_description
|
||||
ename = ename.gsub " ", "_"
|
||||
ename.downcase!
|
||||
ename = ename + ".html"
|
||||
if RSpec.current_example.exception.present?
|
||||
save_page(ename)
|
||||
else
|
||||
capfile = File.expand_path(ename, Capybara.save_and_open_page_path)
|
||||
if File.exist?(capfile)
|
||||
File.unlink(capfile)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue