Commit 7ae2fe13 authored by Mike Greiling's avatar Mike Greiling

fix dynamic u2f fixtures

parent 5f192c77
require 'spec_helper'
describe SessionsController, '(JavaScript fixtures)', type: :controller do
include JavaScriptFixturesHelpers
before(:all) do
clean_frontend_fixtures('u2f/')
end
it 'u2f/authenticate.html.raw' do |example|
fixture = render_template('u2f/_authenticate.html.haml', locals: {
new_user_session_path: "/users/sign_in",
params: {},
resource_name: "user"
})
store_frontend_fixture(fixture, example.description)
end
it 'u2f/register.html.raw' do |example|
user = build(:user, :two_factor_via_otp)
fixture = render_template('u2f/_register.html.haml', locals: {
create_u2f_profile_two_factor_auth_path: '/profile/two_factor_auth/create_u2f',
current_user: user
})
store_frontend_fixture(fixture, example.description)
end
private
def render_template(template, **args)
controller = ApplicationController.new
controller.render_to_string(template: template, layout: false, **args)
end
end
= render partial: "u2f/authenticate", locals: { new_user_session_path: "/users/sign_in", params: {}, resource_name: "user" }
- user = FactoryGirl.build(:user, :two_factor_via_otp)
= render partial: "u2f/register", locals: { create_u2f_profile_two_factor_auth_path: '/profile/two_factor_auth/create_u2f', current_user: user }
......@@ -10,7 +10,7 @@
(function() {
describe('U2FAuthenticate', function() {
fixture.load('static/u2f/authenticate.html.raw');
fixture.load('u2f/authenticate.html.raw');
beforeEach(function() {
this.u2fDevice = new MockU2FDevice;
this.container = $("#js-authenticate-u2f");
......
......@@ -10,7 +10,7 @@
(function() {
describe('U2FRegister', function() {
fixture.load('static/u2f/register.html.raw');
fixture.load('u2f/register.html.raw');
beforeEach(function() {
this.u2fDevice = new MockU2FDevice;
this.container = $("#js-register-u2f");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment