mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 03:53:05 -05:00
stopped using proper settings inside of a test
This commit is contained in:
parent
aa83b5ca5d
commit
416f41e59d
1 changed files with 3 additions and 4 deletions
|
@ -1,6 +1,5 @@
|
||||||
SandboxedModule = require('sandboxed-module')
|
SandboxedModule = require('sandboxed-module')
|
||||||
sinon = require 'sinon'
|
sinon = require 'sinon'
|
||||||
Settings = require 'settings-sharelatex'
|
|
||||||
should = require("chai").should()
|
should = require("chai").should()
|
||||||
MockRequest = require "../helpers/MockRequest"
|
MockRequest = require "../helpers/MockRequest"
|
||||||
MockResponse = require "../helpers/MockResponse"
|
MockResponse = require "../helpers/MockResponse"
|
||||||
|
@ -55,7 +54,7 @@ describe "SubscriptionController sanboxed", ->
|
||||||
apis:
|
apis:
|
||||||
recurly:
|
recurly:
|
||||||
subdomain:"sl.recurly.com"
|
subdomain:"sl.recurly.com"
|
||||||
siteUrl: "http://www.sharelatex.dev:3000"
|
siteUrl: "http://de.sharelatex.dev:3000"
|
||||||
|
|
||||||
@SubscriptionController = SandboxedModule.require modulePath, requires:
|
@SubscriptionController = SandboxedModule.require modulePath, requires:
|
||||||
'../../managers/SecurityManager': @SecurityManager
|
'../../managers/SecurityManager': @SecurityManager
|
||||||
|
@ -88,7 +87,7 @@ describe "SubscriptionController sanboxed", ->
|
||||||
|
|
||||||
it "should set the correct variables for the template", ->
|
it "should set the correct variables for the template", ->
|
||||||
should.exist @res.renderedVariables.signature
|
should.exist @res.renderedVariables.signature
|
||||||
@res.renderedVariables.successURL.should.equal "#{Settings.siteUrl}/user/subscription/update"
|
@res.renderedVariables.successURL.should.equal "#{@settings.siteUrl}/user/subscription/update"
|
||||||
@res.renderedVariables.user.id.should.equal @user.id
|
@res.renderedVariables.user.id.should.equal @user.id
|
||||||
|
|
||||||
describe "with a user without subscription", ->
|
describe "with a user without subscription", ->
|
||||||
|
@ -119,7 +118,7 @@ describe "SubscriptionController sanboxed", ->
|
||||||
@req.session._csrf = @csrfToken = "mock-csrf-token"
|
@req.session._csrf = @csrfToken = "mock-csrf-token"
|
||||||
@res.render = (page, opts)=>
|
@res.render = (page, opts)=>
|
||||||
url = JSON.parse(opts.subscriptionFormOptions).successURL
|
url = JSON.parse(opts.subscriptionFormOptions).successURL
|
||||||
url.should.equal("#{Settings.siteUrl}/user/subscription/create?_csrf=#{@csrfToken}")
|
url.should.equal("#{@settings.siteUrl}/user/subscription/create?_csrf=#{@csrfToken}")
|
||||||
done()
|
done()
|
||||||
@SubscriptionController.paymentPage @req, @res
|
@SubscriptionController.paymentPage @req, @res
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue