Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dummy test app #19

Merged
merged 16 commits into from
Jul 19, 2019
Merged

Dummy test app #19

merged 16 commits into from
Jul 19, 2019

Conversation

pablobm
Copy link
Contributor

@pablobm pablobm commented Sep 7, 2018

When I merged #18, @nickcharlton threw the question of how we could go about testing that. This PR attempts to provide an answer.

Here I set up an dummy app, same as the ones used for engines, as well as feature specs that run on this dummy app.

There are a bunch of files because setting this up is not trivial. In summary, I added:

  1. A dummy app at spec/dummy. I copied it from a newly-created engine project and adapted it to work here.
  2. In the dummy app I added in turn:
    • A couple of models, ensuring a has_many relationship.
    • An admin section with administrate, using administrate-field-nested_has_many.
  3. A feature spec for the problem at hand.
  4. Appraisal, to allow testing the dummy app against different versions of Administrate.

To run the tests: bundle exec appraisal rake. Should document this and set it up on CI.

To run the dummy app: rails s.

On an implementation note, there's too much logic in the template at app/views/fields/nested_has_many/_show.html.erb. This is because I couldn't get a helper to work.

spec/dummy/config/environments/test.rb Show resolved Hide resolved
spec/dummy/config/environments/test.rb Show resolved Hide resolved
spec/dummy/config/environments/development.rb Show resolved Hide resolved
spec/dummy/config/environments/development.rb Show resolved Hide resolved
spec/dummy/config/environments/development.rb Show resolved Hide resolved
spec/rails_helper.rb Show resolved Hide resolved
spec/rails_helper.rb Show resolved Hide resolved
spec/rails_helper.rb Show resolved Hide resolved
spec/rails_helper.rb Show resolved Hide resolved
spec/dummy/db/schema.rb Show resolved Hide resolved
spec/dummy/db/schema.rb Show resolved Hide resolved
spec/dummy/db/schema.rb Show resolved Hide resolved
spec/dummy/db/schema.rb Show resolved Hide resolved
spec/dummy/db/schema.rb Show resolved Hide resolved
spec/dummy/config/puma.rb Show resolved Hide resolved
spec/dummy/config/boot.rb Show resolved Hide resolved
spec/dummy/config/boot.rb Show resolved Hide resolved
spec/dummy/config/boot.rb Show resolved Hide resolved
spec/dummy/config/application.rb Show resolved Hide resolved
spec/dummy/config/application.rb Show resolved Hide resolved
spec/dummy/config/application.rb Show resolved Hide resolved
spec/dummy/config/application.rb Show resolved Hide resolved
spec/dummy/app/mailers/application_mailer.rb Show resolved Hide resolved
spec/dummy/app/mailers/application_mailer.rb Show resolved Hide resolved
spec/dummy/app/assets/config/manifest.js Show resolved Hide resolved
spec/dummy/app/assets/config/manifest.js Show resolved Hide resolved
spec/dummy/app/assets/config/manifest.js Show resolved Hide resolved
spec/dummy/Rakefile Show resolved Hide resolved
@pablobm
Copy link
Contributor Author

pablobm commented Jan 25, 2019

@nickcharlton - I made the last few required changes. I think this is good to go. I have two questions though:

  • Do you think I'm right in removing these files? 781de9d
  • Should I be including the lockfiles in the gemfiles/ directory (as I'm indeed doing here)? I don't know what the state of the art for these things is currently 😕

@nickcharlton
Copy link
Owner

I am, you'll be happy to hear, finally merging your work here!

I think removing them in fine and if it turns out to not be, is not that significant.

We do indeed include the lock files for Appraisals.

@nickcharlton nickcharlton merged commit 564eed2 into nickcharlton:master Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants