-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from spartansystems/fix_named_input
Fix named input
- Loading branch information
Showing
5 changed files
with
27 additions
and
22 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 |
---|---|---|
|
@@ -4,8 +4,8 @@ Gem::Specification.new do |s| | |
s.date = '2015-06-19' | ||
s.summary = 'Atomic CMS' | ||
s.description = 'Live CMS powered by atomic assets.' | ||
s.authors = ['Don Humphreys'] | ||
s.email = '[email protected]' | ||
s.authors = ['Don Humphreys', 'Spartan'] | ||
s.email = '[email protected]' | ||
s.files = `git ls-files`.split(/\n/) | ||
s.test_files = Dir['spec/**/*'] | ||
# s.homepage = 'http://rubygems.org/gems/atomic_cms' | ||
|
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,23 +1,30 @@ | ||
require 'rails_helper' | ||
require "rails_helper" | ||
|
||
RSpec.describe AtomicCms::MediaController, type: :controller do | ||
it 'accepts a post request and fails with bad data' do | ||
scrubber = double('scrubber') | ||
# Previously the engines guide contained an incorrect example that | ||
# recommended using the `use_route` option to test an engine's controllers | ||
# within the dummy application. That recommendation was incorrect and has | ||
# since been corrected. Instead, you should override the `@routes` variable | ||
# in the test case with `Foo::Engine.routes`. | ||
before { @routes = AtomicCms::Engine.routes } | ||
|
||
it "accepts a post request and fails with bad data" do | ||
scrubber = double("scrubber") | ||
allow(MediaScrubber).to receive(:new).and_return(scrubber) | ||
allow(scrubber).to receive(:save).and_return(false) | ||
|
||
post :create, use_route: :atomic_cms, file: double('file') | ||
post :create, file: double("file") | ||
|
||
expect(response).to have_http_status(:unprocessable_entity) | ||
end | ||
|
||
it 'accepts a post with an image' do | ||
scrubber = double('scrubber', save: true, url: 'http://www.google.com') | ||
it "accepts a post with an image" do | ||
scrubber = double("scrubber", save: true, url: "http://www.google.com") | ||
expect(MediaScrubber).to receive(:new).and_return(scrubber) | ||
|
||
post :create, use_route: :atomic_cms, file: double('file') | ||
post :create, file: double("file") | ||
|
||
expect(response).to have_http_status(:created) | ||
expect(response.body).to include('http://www.google.com') | ||
expect(response.body).to include("http://www.google.com") | ||
end | ||
end |
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