leage / rails-exercise-16 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from hpi-swt2-exercise/rails-exercise-16
License: MIT License
This project forked from hpi-swt2-exercise/rails-exercise-16
License: MIT License
When creating a paper with year 'nineteen-fifty'
Then validation should fail
Expected #<paper id: nil, title: "computing machinery and intelligence", venue: "mind 49: 433-460", year: 0, created_at: nil, updated_at: nil> not to be valid
When a user visits the new paper page
Then it should have a button to submit the form
Expected to find css "input[type="submit"]" but there were no matches
Given a paper
When a user visits the paper's edit page
Then it should have a select box for the second author
Create a <label>
for each <select>
and set the for
attribute of the label to the id of the select. For example
f.label "Author 1", for: "paper_author_id_1"
f.collection_select :paper, :author_ids, authors, :id, :name, {selected: @paper.author_ids[1], include_blank: '(none)'}, {name: "paper[author_ids][]", id: "paper_author_id_1"
Expected to find select box "author 2" but there were no matches
When a paper is created with title 'COMPUTING MACHINERY AND INTELLIGENCE',
And venue 'Mind 49: 433-460', and year 1950
Then an instance of Paper should be created
Got NameError: uninitialized constant Paper
When creating a paper without year
Then validation should fail
Expected #<paper id: nil, title: "computing machinery and intelligence", venue: "mind 49: 433-460", year: nil, created_at: nil, updated_at: nil> not to be valid
When an author is created with first name 'Alan', last name 'Turing', and homepage 'http://wikipedia.org/Alan_Turing'
Then an instance of Author should be created
Got NameError: uninitialized constant Author
Given a paper
When users visits the papers index page
Then it should link to the paper page
Expected to find css "a" with text "show" but there were no matches. also found "add paper", which matched the selector but not all filters.
Given an author named 'Alan Turing'
When users visit the authors index page
Then it should have a destroy link
Expected to find css "a" with text "destroy" but there were no matches. also found "show", "edit", "add author", which matched the selector but not all filters.
When creating a paper without title
Then validation should fail
Expected #<paper id: nil, title: nil, venue: "mind 49: 433-460", year: 1950, created_at: nil, updated_at: nil> not to be valid
When a user visits the new author page
Then the page should render
You need to create an AuthorsController
with a new
action and set-up the appropriate routes. See the Rails guide for help.
Got NameError: undefined local variable or method `new_author_path' for #RSpec::ExampleGroups::NewAuthorPage:0x00000007acbd70
Given an author named 'Alan Turing'
When a user visits the author's edit page
Then the page should render
Got AbstractController::ActionNotFound: The action 'edit' could not be found for AuthorsController
Given users visit the new author page
And fill in only first name and homepage
When they click submit
Then the page should report that last name can't be blank
Expected to find text "last name can't be blank" in "new author first name last name homepage"
Given an author
Then it should have an empty list of papers
Got NoMethodError: undefined method `papers' for #Author:0x000000046eaa88
Given an author named 'Alan Turing'
When a user visits the authors index page
Then it should show Turing's name
Expected to find text "alan turing" in "listing authors"
Given a paper published in 1950
And a paper published in 1968
When users visit the papers index page with url parameter year=1950
Then it should not show the paper published in 1968
You can use scopes [1] to implement this behavior.
Expected not to find text "go to statement considered harmful" in "listing authors title venue year computing machinery and intelligence mind 49: 433-460 1950 show edit destroy go to statement considered harmful communications of the acm 1968 show edit destroy add paper"
Given a paper entitled 'COMPUTING MACHINERY AND INTELLIGENCE'
When a user visits the papers index page
Then the page should render
Got AbstractController::ActionNotFound: The action 'index' could not be found for PapersController
When a paper is created with title 'COMPUTING MACHINERY AND INTELLIGENCE',
And venue 'Mind 49: 433-460', and year 1950
Then year should be 1950
Expected: 1950
got: "1950"
(compared using ==)
Given an author named 'Alan Turing'
When a user visits the author's edit page
And changes first name to 'Alan Mathison'
And clicks submit
Then Turing's first name should be updated
Expected: "alan mathison"
got: "alan"
(compared using ==)
Given an author named 'Alan Turing'
When users visit the authors index page
And click 'Destroy'
Then the author should be deleted
Expected: nil
got: #<author id: 1, first_name: "alan", last_name: "turing", homepage: "http://wikipedia.de/alan_turing", created_at: "2016-11-09 11:55:54", updated_at: "2016-11-09 11:55:54">
Given a paper
When users visit the papers index page
And click 'Destroy'
Got AbstractController::ActionNotFound: The action 'destroy' could not be found for PapersController
When a paper is created with title 'COMPUTING MACHINERY AND INTELLIGENCE',
And venue 'Mind 49: 433-460', and year 1950
Then an instance of Paper should be created
Got ActiveRecord::UnknownAttributeError: unknown attribute 'title' for Paper.
Given an author named 'Alan Turing'
When users visits the authors index page
Then it should link to the author page
Expected to find css "a" with text "show" but there were no matches. also found "add author", which matched the selector but not all filters.
Given a paper
When a user visits the paper's edit page
Then the page should render
Got AbstractController::ActionNotFound: The action 'edit' could not be found for PapersController
When users visits the authors index page
Then it has a link 'Add author'
Expected to find css "a" with text "add author" but there were no matches. also found "add author", which matched the selector but not all filters.
Given a paper entitled 'COMPUTING MACHINERY AND INTELLIGENCE'
When a user visits the paper's page
Then it should show the paper's title
Expected to find text matching /title: computing machinery and intelligence/i in "title computing machinery and intelligence venue mind 49: 433-460 year 1950"
Given a paper
Then it should have an empty list of authors
Got NoMethodError: undefined method `authors' for #Paper:0x00000007e93a48
When a user visits the new author page
Then it should have a field 'Title'
Expected to find field "title" but there were no matches
Given a paper with one author
When a user visits the paper's edit page
Then the first select box should show the authors name
Expected to find select box "author 1" with "alan turing" selected but there were no matches. also found "(none) alan turing", which matched the selector but not all filters.
Given a paper
When a user visits the paper's edit page
And changes venue to 'Mind 49'
Got Capybara::ElementNotFound: Unable to find field "paper_venue"
When creating an author without last name
Then validation should fail
Expected #<author id: nil, first_name: "alan", last_name: nil, homepage: "http://example.com", created_at: nil, updated_at: nil> not to be valid
Given an author named 'Alan Turing'
When users visit the authors index page
Then it should link to the author's edit page
Expected to find css "a" with text "edit" but there were no matches. also found "show", "add author", which matched the selector but not all filters.
When a user visits the new author page
Then it should have a field 'Venue'
Expected to find field "venue" but there were no matches
When a user visits the new author page
Then the page should render
You need to create an AuthorsController
with a new
action and set-up the appropriate routes. See the Rails guide for help.
Got NameError: undefined local variable or method `new_author_path' for #RSpec::ExampleGroups::NewAuthorPage:0x00000006ecc498
Given a paper with an author
When a user visits the paper page
Then it should show the author's name
Expected to find text "alan turing" in "title: computing machinery and intelligence venue: mind 49: 433-460 year: 1950"
When creating a paper without venue
Then validation should fail
Expected #<paper id: nil, title: "computing machinery and intelligence", venue: nil, year: 1950, created_at: nil, updated_at: nil> not to be valid
When a user visits the new author page
And fills in 'Alan', 'Turing', and 'http://wikipedia.org/Alan_Turing', respectively
Got Capybara::ElementNotFound: Unable to find field "author_first_name"
When a user visits the new author page
Then it should have a field 'Year'
Expected to find field "year" but there were no matches
Given a paper
When a user visits the paper's edit page
Then it should have a select box for the first author
Create a <label>
for each <select>
and set the for
attribute of the label to the id of the select. For example
f.label "Author 1", for: "paper_author_id_1"
f.collection_select :paper, :author_ids, authors, :id, :name, {selected: @paper.author_ids[1], include_blank: '(none)'}, {name: "paper[author_ids][]", id: "paper_author_id_1"
Expected to find field "author 1" but there were no matches
When users visits the authors index page
Then it has a link 'Add author'
Expected to find css "a" with text "add author" but there were no matches
Given an author a
with first name 'Alan' and last name 'Turing'
Then a.name
should be 'Alan Turing'
Got NoMethodError: undefined method `name' for #Author:0x000000060991a0
When a user visits the new author page
Then it should have a field 'Title'
Expected to find field "title" but there were no matches
Given users visit the new paper page
And fill in only venue and year
When they click submit
Then the page should report that title can't be blank
Expected to find text "title can't be blank" in "listing authors title venue year add paper"
Given a paper with one author
And another author called 'Peter Plagiarist'
When a user visits the paper's edit page
And the selects 'Peter Plagiarist' as first author
And submits the form
Then 'Peter Plagiarist' should be author of the paper
Expected #<activerecord::associations::collectionproxy [#<author id: 1, first_name: "alan", last_name: "turing", homepage: "http://wikipedia.de/alan_turing", created_at: "2016-11-19 16:03:14", updated_at: "2016-11-19 16:03:14">]> to include #<author id: 2, first_name: "peter", last_name: "plagiarist", homepage: "http://wikipedia.de/alan_turing", created_at: "2016-11-19 16:03:14", updated_at: "2016-11-19 16:03:14">
diff:
@@ -1,7 +1,7 @@
-[#<author:0x0000000630f330
When a user visits the new author page
Then the page should render
You need to create an AuthorsController
with a new
action and set-up the appropriate routes. See the Rails guide for help.
Got NameError: undefined local variable or method `new_author_path' for #RSpec::ExampleGroups::NewAuthorPage:0x00000006b5e3b0
When a paper is created with title 'COMPUTING MACHINERY AND INTELLIGENCE',
And venue 'Mind 49: 433-460', and year 1950
Then year should be 1950
Expected: 1950
got: "1950"
(compared using ==)
When a user visits the new author page
Then the page should render
Got NameError: undefined local variable or method `new_paper_path' for #RSpec::ExampleGroups::NewPaperPage:0x00000008294e80
Given a paper
When users visit the papers index page
Then it should link to the paper's edit page
Expected to find css "a" with text "edit" but there were no matches. also found "show", "add paper", which matched the selector but not all filters.
When a user visits the authors index page
Then the page should render
Got AbstractController::ActionNotFound: The action 'index' could not be found for AuthorsController
When users visits the papers index page
Then it has a link 'Add paper'
Expected to find css "a" with text "add paper" but there were no matches
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.