public When_config_variables_are_entered() { _Deploy = new Mock <IDeploymentService>(MockBehavior.Strict); string slug; _Deploy.Setup(d => d.Deploy(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <App>(), It.IsAny <Dictionary <string, string> >(), out slug)) .Returns(DeploymentResult.Success) .Callback <string, string, App, Dictionary <string, string>, string>((name, region, app, vars, alug) => { _ReceivedVars = vars; });; _Browser = Testing.CreateBrowser <SecuredPagesModule>(with => { with.LoggedInUser(); with.Deployment(_Deploy); }); _Response = _Browser.Post("/Deploy/jabbr", with => { with.FormValue("application_name", "JabbR Test"); with.FormValue("region_id", "amazon-web-services::us-east-1"); with.FormValue("auth.apiKey", "test api key"); with.FormValue("auth.appName", "test app name"); with.FormValue("googleAnalytics", "test analytics key"); }); }
public When_user_signs_out() { _Browser = Testing.CreateBrowser <OAuthModule>(with => { with.LoggedInUser(); }); _Response = _Browser.Get("/SignOut"); }
public When_requesting_an_app_that_doesnt_exist() { _Browser = Testing.CreateBrowser <SecuredPagesModule>(with => { with.LoggedInUser(); }); _Response = _Browser.Get("/Deploy/foofoo"); }
public When_displaying_the_deploy_page() { _Browser = Testing.CreateBrowser <SecuredPagesModule>(with => { with.LoggedInUser(); }); _Response = _Browser.Get("/Deploy/jabbr"); }
public When_a_success_message_is_present() { _Browser = Testing.CreateBrowser <PagesModule>(with => { with.Session(SessionKeys.FLASH_SUCCESS, "All done!"); }); _Response = _Browser.Get("/"); }
public When_no_payload_is_sent() { _Browser = Testing.CreateBrowser <HookModule>(); _Response = _Browser.Post("/Sites/foofoo/NotifyByEmail", with => { with.Query("email", "*****@*****.**"); }); }
public When_an_error_message_is_present() { _Browser = Testing.CreateBrowser <PagesModule>(with => { with.Session(SessionKeys.FLASH_ERROR, "There was an error!"); }); _Response = _Browser.Get("/"); }
public When_user_is_logged_on() { _Browser = Testing.CreateBrowser <PagesModule>(with => { with.LoggedInUser(); }); _Response = _Browser.Get("/"); }
public When_no_email_is_passed() { _Api = new Mock <IApiService>(MockBehavior.Strict); _Browser = Testing.CreateBrowser <SecuredPagesModule>(with => { with.LoggedInUser(); with.Api(_Api); }); _Response = _Browser.Put("/Sites/testsite/Notifications/Email"); }
public When_requesting_the_sign_in_page() { _OAuth = new Mock <IOAuth>(MockBehavior.Strict); _OAuth.Setup(d => d.GetAuthUrl()).Returns("http://www.test.com"); _Browser = Testing.CreateBrowser <OAuthModule>(with => { with.OAuth(_OAuth); }); _Response = _Browser.Get("/SignIn"); }
public When_no_application_name_is_specified() { _Browser = Testing.CreateBrowser <SecuredPagesModule>(with => { with.LoggedInUser(); }); _Response = _Browser.Post("/Deploy/jabbr", with => { with.FormValue("region_id", "amazon-web-services::us-east-1"); }); }
public When_no_code_is_sent() { _OAuth = new Mock <IOAuth>(MockBehavior.Strict); _Browser = Testing.CreateBrowser <OAuthModule>(with => { with.OAuth(_OAuth); }); _Response = _Browser.Get("/callback", with => { }); }
public When_no_region_id_is_specified() { _Browser = Testing.CreateBrowser <SecuredPagesModule>(with => { with.LoggedInUser(); }); _Response = _Browser.Post("/Deploy/jabbr", with => { with.FormValue("application_name", "foo"); }); }
public When_a_redirect_url_is_specified() { _OAuth = new Mock <IOAuth>(MockBehavior.Strict); _OAuth.Setup(d => d.GetAuthUrl()).Returns("http://www.test.com"); _Browser = Testing.CreateBrowser <OAuthModule>(with => { with.OAuth(_OAuth); }); _Response = _Browser.Get("/SignIn", with => { with.Query("redirect", "/Test"); }); }
public When_code_can_not_be_exchanged_for_access_token() { _OAuth = new Mock <IOAuth>(MockBehavior.Strict); _OAuth.Setup(d => d.GetAccessToken(It.IsAny <string>())).Returns((string)null); _Browser = Testing.CreateBrowser <OAuthModule>(with => { with.OAuth(_OAuth); }); _Response = _Browser.Get("/callback", with => { with.Query("code", "testcode"); }); }
public When_oauth_callback_is_received() { _OAuth = new Mock <IOAuth>(MockBehavior.Strict); _OAuth.Setup(d => d.GetAccessToken(It.IsAny <string>())).Returns("12345"); _Browser = Testing.CreateBrowser <OAuthModule>(with => { with.OAuth(_OAuth); }); _Response = _Browser.Get("/callback", with => { with.Query("code", "testcode"); }); }
public When_a_redirect_was_specified() { _OAuth = new Mock <IOAuth>(MockBehavior.Strict); _OAuth.Setup(d => d.GetAccessToken(It.IsAny <string>())).Returns("12345"); _Browser = Testing.CreateBrowser <OAuthModule>(with => { with.OAuth(_OAuth); with.Session(SessionKeys.SIGN_IN_REDIRECT, "/Test"); }); _Response = _Browser.Get("/callback", with => { with.Query("code", "testcode"); }); }
public When_displaying_the_sites_page() { var api = new Mock <IApiService>(MockBehavior.Strict); api.Setup(d => d.GetApplications()).Returns(new[] { new Application { Slug = "test", Name = "My Test Site" } }); _Browser = Testing.CreateBrowser <SecuredPagesModule>(with => { with.LoggedInUser(); with.Api(api); }); _Response = _Browser.Get("/Sites"); }
public When_application_creation_fails() { _Deploy = new Mock <IDeploymentService>(MockBehavior.Strict); string slug; _Deploy.Setup(d => d.Deploy(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <App>(), It.IsAny <Dictionary <string, string> >(), out slug)).Returns(DeploymentResult.UnableToCreateApplication); _Browser = Testing.CreateBrowser <SecuredPagesModule>(with => { with.LoggedInUser(); with.Deployment(_Deploy); }); _Response = _Browser.Post("/Deploy/jabbr", with => { with.FormValue("application_name", "JabbR Test"); with.FormValue("region_id", "amazon-web-services::us-east-1"); }); }
public When_enabling_a_notification() { _Api = new Mock <IApiService>(MockBehavior.Strict); _Api.Setup(d => d.CreateServicehook(It.IsAny <string>(), It.IsAny <string>())).Returns(new CreateResult { Status = CreateStatus.Created }); _Browser = Testing.CreateBrowser <SecuredPagesModule>(with => { with.LoggedInUser(); with.Api(_Api); }); _Response = _Browser.Put("/Sites/testsite/Notifications/Email", ctx => { ctx.FormValue("email", "*****@*****.**"); }); }
public When_a_notification_is_sent() { _Mail = new Mock <IMailService>(MockBehavior.Strict); _Mail.Setup(d => d.SendEmail(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())); _Browser = Testing.CreateBrowser <HookModule>(with => { with.Mail(_Mail); }); _Response = _Browser.Post("/Sites/foofoo/NotifyByEmail", with => { with.JsonBody(new ServiceHookModel { Application = new ServiceHookApplicationModel { Name = "Foo Foo" }, Build = new ServiceHookBuildModel { Status = "Succeeded", Commit = new ServiceHookCommitModel { Id = "12345", Message = "Test Message" } } }); with.Query("email", "*****@*****.**"); }); }
public When_an_anonymous_user_calls_sites() { _Browser = Testing.CreateBrowser <SecuredPagesModule>(); _Response = _Browser.Get("/Sites"); }
public When_displaying_the_home_page() { _Browser = Testing.CreateBrowser <PagesModule>(); _Response = _Browser.Get("/"); }
public When_no_user_is_logged_on() { _Browser = Testing.CreateBrowser <PagesModule>(); _Response = _Browser.Get("/"); }
public When_requesting_static_content() { _Browser = Testing.CreateBrowser <PagesModule>(); }
public When_no_email_is_sent() { _Browser = Testing.CreateBrowser <HookModule>(); _Response = _Browser.Post("/Sites/foofoo/NotifyByEmail"); }