コード例 #1
0
ファイル: buoyService_test.go プロジェクト: jharlap/beego-mgo
// Test_Region checks the region service call is working
func Test_Region(t *testing.T) {
	service := Prepare()
	defer Finish(service)

	region := "Gulf Of Mexico"

	buoyStations, err := buoyService.FindRegion(service, region)

	Convey("Subject: Test Region Service", t, func() {
		Convey("Should Be Able To Perform A Search", func() {
			So(err, ShouldEqual, nil)
		})
		Convey("Should Have Region Data", func() {
			So(len(buoyStations), ShouldBeGreaterThan, 0)
		})
	})
}
コード例 #2
0
ファイル: buoyController.go プロジェクト: ZloiBubr/beego-mgo
// Index is the initial view for the buoy system.
func (controller *BuoyController) Index() {
	region := "Gulf Of Mexico"
	log.Startedf(controller.UserID, "BuoyController.Index", "Region[%s]", region)

	buoyStations, err := buoyService.FindRegion(&controller.Service, region)
	if err != nil {
		log.CompletedErrorf(err, controller.UserID, "BuoyController.Index", "Region[%s]", region)
		controller.ServeError(err)
		return
	}

	controller.Data["Stations"] = buoyStations
	controller.Layout = "shared/basic-layout.html"
	controller.TplNames = "buoy/content.html"
	controller.LayoutSections = map[string]string{}
	controller.LayoutSections["PageHead"] = "buoy/page-head.html"
	controller.LayoutSections["Header"] = "shared/header.html"
	controller.LayoutSections["Modal"] = "shared/modal.html"
}
コード例 #3
0
ファイル: buoyController.go プロジェクト: pmljm/beego-mgo
// Index is the initial view for the buoy system
func (this *BuoyController) Index() {
	region := "Gulf Of Mexico"
	tracelog.STARTEDf(this.UserId, "BuoyController.Index", "Region[%s]", region)

	buoyStations, err := buoyService.FindRegion(&this.Service, region)
	if err != nil {
		tracelog.COMPLETED_ERRORf(err, this.UserId, "BuoyController.Index", "Region[%s]", region)
		this.ServeError(err)
		return
	}

	this.Data["Stations"] = buoyStations
	this.Layout = "shared/basic-layout.html"
	this.TplNames = "buoy/content.html"
	this.LayoutSections = map[string]string{}
	this.LayoutSections["PageHead"] = "buoy/page-head.html"
	this.LayoutSections["Header"] = "shared/header.html"
	this.LayoutSections["Modal"] = "shared/modal.html"
}