This repository has been archived by the owner on Mar 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update project to load ptagora dummy data
- Loading branch information
Showing
8 changed files
with
185 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,41 @@ | ||
|
||
# ==== Users ==== | ||
|
||
- &user1 !!models.User | ||
email: [email protected] | ||
name: Utilizador Administrador | ||
password: admin | ||
|
||
- &user2 !!models.User | ||
email: [email protected] | ||
name: Gonçalo Fortes | ||
password: segredo | ||
|
||
|
||
# ==== Tags ==== | ||
|
||
- &tag1 !!models.Tag | ||
title: Portugal-atractivo | ||
description: Aqui fica a descrição deste tema... | ||
|
||
- &tag2 !!models.Tag | ||
title: Portugal-do-conhecimento | ||
description: Aqui fica a descrição deste tema... | ||
|
||
- &tag3 !!models.Tag | ||
title: Portugal-empreendedor | ||
description: Aqui fica a descrição deste tema... | ||
|
||
- &tag4 !!models.Tag | ||
title: Geral | ||
description: Todas as propostas que não encaixam nos outros temas | ||
|
||
|
||
# ==== Proposals ==== | ||
|
||
- &prop1 !!models.Proposal | ||
id: 1 | ||
title: Costa da inovação | ||
problem: Eixo Atracção Profissional | ||
solution: Promover Portugal como lugar de residência e trabalho para pessoas com profissões que são independente de qualquer local (IT por exemplo) | ||
benefits: Mais empresas, mais postos de trabalho altemente qualificados, sinergias, efeitos de “bola de neve” (uns araem outros tipo “Silicon Valley” | ||
views: 968 | ||
upvotes: 8624 | ||
downvotes: 17 | ||
timestamp: 2013-03-08 14:59:30.252 | ||
tag: Portugal-Atractivo | ||
proposer: *user1 | ||
|
||
- &prop2 !!models.Proposal | ||
id: 2 | ||
title: Fazer do turismo um grande desígnio nacional | ||
problem: Eixo Turismo e Eventos | ||
solution: Fazer, fazer, fazer | ||
benefits: À vista de todos | ||
views: 200 | ||
upvotes: 1 | ||
downvotes: 624 | ||
timestamp: 2012-09-04 14:16:12 | ||
tag: Portugal-Empreendedor | ||
proposer: *user2 | ||
|
||
# ==== Users ==== | ||
|
||
- &user1 !!models.User | ||
email: [email protected] | ||
name: Utilizador Administrador | ||
password: admin | ||
|
||
- &user2 !!models.User | ||
email: [email protected] | ||
name: Gonçalo Fortes | ||
password: segredo | ||
|
||
|
||
# ==== Proposals ==== | ||
|
||
- &prop1 !!models.Proposal | ||
id: 1 | ||
title: Costa da inovação | ||
problem: Eixo Atracção Profissional | ||
solution: Promover Portugal como lugar de residência e trabalho para pessoas com profissões que são independente de qualquer local (IT por exemplo) | ||
benefits: Mais empresas, mais postos de trabalho altemente qualificados, sinergias, efeitos de “bola de neve” (uns araem outros tipo “Silicon Valley” | ||
views: 968 | ||
upvotes: 8624 | ||
downvotes: 17 | ||
timestamp: 2013-03-08 14:59:30.252 | ||
tag: Portugal-Atractivo | ||
proposer: *user1 | ||
|
||
- &prop2 !!models.Proposal | ||
id: 2 | ||
title: Fazer do turismo um grande desígnio nacional | ||
problem: Eixo Turismo e Eventos | ||
solution: Fazer, fazer, fazer | ||
benefits: À vista de todos | ||
views: 200 | ||
upvotes: 1 | ||
downvotes: 624 | ||
timestamp: 2012-09-04 14:16:12 | ||
tag: Portugal-Empreendedor | ||
proposer: *user2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.13.0 | ||
sbt.version=0.13.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// Comment to get more information during initialization | ||
logLevel := Level.Warn | ||
|
||
// The Typesafe repository | ||
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" | ||
|
||
// Use the Play sbt plugin for Play projects | ||
// Comment to get more information during initialization | ||
logLevel := Level.Warn | ||
|
||
// The Typesafe repository | ||
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" | ||
|
||
// Use the Play sbt plugin for Play projects | ||
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.junit.*; | ||
|
||
import play.mvc.*; | ||
import play.test.*; | ||
import play.data.DynamicForm; | ||
import play.data.validation.ValidationError; | ||
import play.data.validation.Constraints.RequiredValidator; | ||
import play.i18n.Lang; | ||
import play.libs.F; | ||
import play.libs.F.*; | ||
|
||
import static play.test.Helpers.*; | ||
import static org.fest.assertions.Assertions.*; | ||
|
||
|
||
/** | ||
* | ||
* Simple (JUnit) tests that can call all parts of a play app. | ||
* If you are interested in mocking a whole application, see the wiki for more details. | ||
* | ||
*/ | ||
public class ApplicationTest { | ||
|
||
// @Test | ||
// public void simpleCheck() { | ||
// int a = 1 + 1; | ||
// assertThat(a).isEqualTo(2); | ||
// } | ||
// | ||
// @Test | ||
// public void renderTemplate() { | ||
// Content html = views.html.main.render("Page Title"); | ||
// assertThat(contentType(html)).isEqualTo("text/html"); | ||
// assertThat(contentAsString(html)).contains("DCID"); | ||
// } | ||
|
||
} | ||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.junit.*; | ||
|
||
import play.mvc.*; | ||
import play.test.*; | ||
import play.data.DynamicForm; | ||
import play.data.validation.ValidationError; | ||
import play.data.validation.Constraints.RequiredValidator; | ||
import play.i18n.Lang; | ||
import play.libs.F; | ||
import play.libs.F.*; | ||
|
||
import static play.test.Helpers.*; | ||
import static org.fest.assertions.Assertions.*; | ||
|
||
|
||
/** | ||
* | ||
* Simple (JUnit) tests that can call all parts of a play app. | ||
* If you are interested in mocking a whole application, see the wiki for more details. | ||
* | ||
*/ | ||
public class ApplicationTest { | ||
|
||
// @Test | ||
// public void simpleCheck() { | ||
// int a = 1 + 1; | ||
// assertThat(a).isEqualTo(2); | ||
// } | ||
// | ||
// @Test | ||
// public void renderTemplate() { | ||
// Content html = views.html.main.render("Page Title"); | ||
// assertThat(contentType(html)).isEqualTo("text/html"); | ||
// assertThat(contentAsString(html)).contains("DCID"); | ||
// } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
package models; | ||
|
||
import models.*; | ||
|
||
import org.junit.*; | ||
|
||
import com.avaje.ebean.Ebean; | ||
|
||
import static org.junit.Assert.*; | ||
import play.libs.Yaml; | ||
import play.test.WithApplication; | ||
import static play.test.Helpers.*; | ||
|
||
public class ProposalTest extends WithApplication { | ||
|
||
@Before | ||
public void setUp() { | ||
start(fakeApplication(inMemoryDatabase())); | ||
} | ||
|
||
// creation and retrieval of a proposal | ||
@Test | ||
public void createAndRetrieveProposal() { | ||
new User("[email protected]", "Bob", "secret").save(); | ||
Proposal prop = Proposal.createAndSave("Build a new park", "There is none.", "We build it.", "We get happy.", "[email protected]"); | ||
|
||
assertNotNull(prop); // test retrieval | ||
assertEquals("Build a new park", prop.title); // test correct creation and storage | ||
assertEquals("Bob", prop.proposer.getName()); // test correct storage of User | ||
} | ||
|
||
// test the calculation of (positive and negative) scores | ||
@Test | ||
public void calculateScore() { | ||
new User("[email protected]", "Bob", "secret").save(); | ||
Proposal prop = Proposal.createAndSave("Build a new park", "There is none.", "We build it.", "We get happy.", "[email protected]"); | ||
|
||
prop.upvotes = 300; | ||
prop.downvotes = 100; | ||
assertEquals(200, prop.getScore()); // score = upvotes - downvotes | ||
prop.upvotes = 100; // switch values... | ||
prop.downvotes = 300; | ||
assertEquals(-200, prop.getScore()); // and test negative score (they are acceptable) | ||
} | ||
package models; | ||
|
||
import models.*; | ||
|
||
import org.junit.*; | ||
|
||
import com.avaje.ebean.Ebean; | ||
|
||
import static org.junit.Assert.*; | ||
import play.libs.Yaml; | ||
import play.test.WithApplication; | ||
import static play.test.Helpers.*; | ||
|
||
public class ProposalTest extends WithApplication { | ||
|
||
@Before | ||
public void setUp() { | ||
start(fakeApplication(inMemoryDatabase())); | ||
} | ||
|
||
// creation and retrieval of a proposal | ||
@Test | ||
public void createAndRetrieveProposal() { | ||
new User("[email protected]", "Bob", "secret").save(); | ||
Proposal prop = Proposal.createAndSave("Build a new park", "There is none.", "We build it.", "We get happy.", "[email protected]"); | ||
|
||
assertNotNull(prop); // test retrieval | ||
assertEquals("Build a new park", prop.title); // test correct creation and storage | ||
assertEquals("Bob", prop.proposer.getName()); // test correct storage of User | ||
} | ||
|
||
// test the calculation of (positive and negative) scores | ||
@Test | ||
public void calculateScore() { | ||
new User("[email protected]", "Bob", "secret").save(); | ||
Proposal prop = Proposal.createAndSave("Build a new park", "There is none.", "We build it.", "We get happy.", "[email protected]"); | ||
|
||
prop.upvotes = 300; | ||
prop.downvotes = 100; | ||
assertEquals(200, prop.getScore()); // score = upvotes - downvotes | ||
prop.upvotes = 100; // switch values... | ||
prop.downvotes = 300; | ||
assertEquals(-200, prop.getScore()); // and test negative score (they are acceptable) | ||
} | ||
} |
Oops, something went wrong.