rspec-cells 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/CHANGES.textile +4 -0
 - data/lib/rspec/cells/cell_example_group.rb +11 -1
 - data/lib/rspec/cells/version.rb +1 -1
 - data/spec/cells/cell_spec_spec.rb +19 -0
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: c15cd7f3164970398e2a3848677d2da3b4c842a9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 264bee54540aaaa5455e6b9a6ed4c386e30e11f7
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: fb31b0a27be1796863f005389306856f7eff9cae2a48e236d3a2728ed3d34fd2f1d083a214f54485c9d4ee1a0d57559dbda6948bd5143b6671bc0829f6264646
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 3500fb97930f1a40137112fc5d26857a76186e388b82e57cad754734835b30b36347901a725fdff99c40742004dbd33ffc9d7746441cff7ef002fb3ad61ed769
         
     | 
    
        data/CHANGES.textile
    CHANGED
    
    
| 
         @@ -54,6 +54,11 @@ module RSpec::Rails 
     | 
|
| 
       54 
54 
     | 
    
         
             
                      return Capybara.string(content) if content.is_a?(String)
         
     | 
| 
       55 
55 
     | 
    
         
             
                      content
         
     | 
| 
       56 
56 
     | 
    
         
             
                    end
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
                    # TODO: test that properly.
         
     | 
| 
      
 59 
     | 
    
         
            +
                    def stub(*args)
         
     | 
| 
      
 60 
     | 
    
         
            +
                      @cell.stub(*args)
         
     | 
| 
      
 61 
     | 
    
         
            +
                    end
         
     | 
| 
       57 
62 
     | 
    
         
             
                  end
         
     | 
| 
       58 
63 
     | 
    
         
             
                end
         
     | 
| 
       59 
64 
     | 
    
         | 
| 
         @@ -83,6 +88,11 @@ module RSpec::Rails 
     | 
|
| 
       83 
88 
     | 
    
         
             
            end
         
     | 
| 
       84 
89 
     | 
    
         | 
| 
       85 
90 
     | 
    
         
             
            RSpec.configure do |c|
         
     | 
| 
       86 
     | 
    
         
            -
               
     | 
| 
      
 91 
     | 
    
         
            +
              if RSpec::Core::Version::STRING.starts_with?("3")
         
     | 
| 
      
 92 
     | 
    
         
            +
                c.include RSpec::Rails::CellExampleGroup, :file_path => /spec\/cells/
         
     | 
| 
      
 93 
     | 
    
         
            +
              else
         
     | 
| 
      
 94 
     | 
    
         
            +
                c.include RSpec::Rails::CellExampleGroup, :example_group => { :file_path => /spec\/cells/ }
         
     | 
| 
      
 95 
     | 
    
         
            +
              end
         
     | 
| 
      
 96 
     | 
    
         
            +
             
     | 
| 
       87 
97 
     | 
    
         
             
              c.include RSpec::Rails::CellExampleGroup, :type => :cell
         
     | 
| 
       88 
98 
     | 
    
         
             
            end
         
     | 
    
        data/lib/rspec/cells/version.rb
    CHANGED
    
    
| 
         @@ -11,6 +11,12 @@ class DummyCell < Cell::Base 
     | 
|
| 
       11 
11 
     | 
    
         
             
              end
         
     | 
| 
       12 
12 
     | 
    
         
             
            end
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
      
 14 
     | 
    
         
            +
            class SongCell < Cell::ViewModel
         
     | 
| 
      
 15 
     | 
    
         
            +
              def show
         
     | 
| 
      
 16 
     | 
    
         
            +
                "#{model}!"
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
            end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
       14 
20 
     | 
    
         | 
| 
       15 
21 
     | 
    
         
             
            module RSpec::Rails
         
     | 
| 
       16 
22 
     | 
    
         | 
| 
         @@ -33,6 +39,19 @@ module RSpec::Rails 
     | 
|
| 
       33 
39 
     | 
    
         
             
                  it "allows passing state args" do
         
     | 
| 
       34 
40 
     | 
    
         
             
                    expect(group.new.render_cell(:dummy, :update, "this")).to eq('Updating this.')
         
     | 
| 
       35 
41 
     | 
    
         
             
                  end
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                  # view model
         
     | 
| 
      
 44 
     | 
    
         
            +
                  # call state
         
     | 
| 
      
 45 
     | 
    
         
            +
                  it "allows rendering view model" do
         
     | 
| 
      
 46 
     | 
    
         
            +
                    expect(group.new.cell(:song, "Hangover").show).to eq("Hangover!")
         
     | 
| 
      
 47 
     | 
    
         
            +
                  end
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                  # stubbing #cell
         
     | 
| 
      
 50 
     | 
    
         
            +
                  it do
         
     | 
| 
      
 51 
     | 
    
         
            +
                    cell = group.new.cell(:song, "Hangover")
         
     | 
| 
      
 52 
     | 
    
         
            +
                    cell.stub(:model => "Swarming Goblets")
         
     | 
| 
      
 53 
     | 
    
         
            +
                    expect(cell.show).to eq("Swarming Goblets!")
         
     | 
| 
      
 54 
     | 
    
         
            +
                  end
         
     | 
| 
       36 
55 
     | 
    
         
             
                end
         
     | 
| 
       37 
56 
     | 
    
         | 
| 
       38 
57 
     | 
    
         
             
                it "responds to #cell" do
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: rspec-cells
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Nick Sutterer
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-08-14 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: railties
         
     |